aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-09-17 15:05:04 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-06-30 10:32:57 +0200
commit0ca2b46893f73ec1dff9440cd462f9c64b989335 (patch)
treec21b8ef652702d1dda9af3780ebd088379b09914 /src
parent5da2576633bc0d0150a8607a30ab1f66f040bb19 (diff)
Avoid double deletion of QQuickWindow
It's uncertain why 4fc0df58b8458052a818e3e970a97457882808e6 added the call to sendPostedEvents(0, QEvent::DeferredDelete) but now we can see that it easily results in the destructor calling itself, and therefore double-deleting its own d_ptr. removePostedEvents seems safer to ensure that the window cannot be doubly deleted, in spite of the qdoc warning that "You should never need to call this function." Task-number: QTBUG-33436 Change-Id: I4873ebe179dde551407eba1f6baac5f03ca7f177 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index e78f9141a8..6276bedc0b 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1093,6 +1093,7 @@ 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