Windows: Remove Window from list before calling DestroyWindow.

Change-Id: Ifef99d9e4e46f0450cecf8ecba18ce79ebec3e8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-12-19 12:05:59 +01:00 committed by Qt by Nokia
parent 92464faea9
commit bbc098ab9f

View File

@ -648,11 +648,11 @@ void QWindowsWindow::destroyWindow()
{
if (QWindowsContext::verboseIntegration || QWindowsContext::verboseWindows)
qDebug() << __FUNCTION__ << this << window() << m_data.hwnd;
if (m_data.hwnd) {
if (m_data.hwnd) { // Stop event dispatching before Window is destroyed.
unregisterDropSite();
QWindowsContext::instance()->removeWindow(m_data.hwnd);
if (m_data.hwnd != GetDesktopWindow())
DestroyWindow(m_data.hwnd);
QWindowsContext::instance()->removeWindow(m_data.hwnd);
m_data.hwnd = 0;
}
}