Windows: Fix exit crash related to deletion of platform screens.

Do not delete screens in the destructor as this might call
back to the Windows and use QWindowsContext.

Change-Id: I5e66e480d4b6ddb8b17cc92e4bef93013e336be6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2012-01-27 14:49:02 +01:00 committed by Qt by Nokia
parent d21f28956e
commit 69b9943d94
3 changed files with 3 additions and 6 deletions

View File

@ -291,6 +291,7 @@ QWindowsContext::~QWindowsContext()
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
OleUninitialize();
d->m_screenManager.clearScreens(); // Order: Potentially calls back to the windows.
m_instance = 0;
}

View File

@ -304,11 +304,6 @@ QWindowsScreenManager::QWindowsScreenManager() :
{
}
QWindowsScreenManager::~QWindowsScreenManager()
{
qDeleteAll(m_screens);
}
/*!
\brief Triggers synchronization of screens (WM_DISPLAYCHANGE).

View File

@ -114,7 +114,8 @@ public:
typedef QList<QWindowsScreen *> WindowsScreenList;
QWindowsScreenManager();
~QWindowsScreenManager();
inline void clearScreens() { qDeleteAll(m_screens); m_screens.clear(); }
void handleScreenChanges();
bool handleDisplayChange(WPARAM wParam, LPARAM lParam);