Do not send deferred deletes from the QQuickWindow dtor
authorLaszlo Agocs <laszlo.agocs@digia.com>
Tue, 26 Aug 2014 08:28:53 +0000 (10:28 +0200)
committerLaszlo Agocs <laszlo.agocs@digia.com>
Tue, 26 Aug 2014 09:46:50 +0000 (11:46 +0200)
Otherwise doing deleteLater() on an ancestor of the QQuickWindow will
cause double deletion for that ancestor. This is typical when using
WA_DeleteOnClose since that uses deleteLater().

Task-number: QTBUG-40920
Change-Id: I9146fc0854f77c42cad2eda23b3cdaa7a9e22080
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
src/quick/items/qquickwindow.cpp

index 1ec7837..5172689 100644 (file)
@@ -1108,8 +1108,6 @@ QQuickWindow::~QQuickWindow()
         d->windowManager->windowDestroyed(this);
     }
 
-    QCoreApplication::removePostedEvents(this, QEvent::DeferredDelete);
-    QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
     delete d->incubationController; d->incubationController = 0;
 #ifndef QT_NO_DRAGANDDROP
     delete d->dragGrabber; d->dragGrabber = 0;