diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-02-24 13:33:59 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-27 06:55:18 +0100 |
commit | 4fc0df58b8458052a818e3e970a97457882808e6 (patch) | |
tree | b2723783c0d6050ccf7b287e477b4637d8f9636d /src | |
parent | 15dac112df4f44ba8b15047720e1570fd4096f26 (diff) |
Force to send defer deletion events before deleting QQuickCanvas
Also change the assert in QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate()
to a warning message.
Change-Id: Ic1fb7e0b7ffe4a54458a0f3a65127b1afd6dda53
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquickcanvas.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 2031bc424a..dca0ef2faf 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -355,7 +355,8 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate() { - Q_ASSERT(inProgressCreations == 0); + if (inProgressCreations) + qWarning() << QDeclarativeEngine::tr("There are still \"%1\" items in the process of being created at engine destruction.").arg(inProgressCreations); while (cleanup) { QDeclarativeCleanup *c = cleanup; diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp index a9df484a98..6b0eb5b96b 100644 --- a/src/quick/items/qquickcanvas.cpp +++ b/src/quick/items/qquickcanvas.cpp @@ -746,6 +746,7 @@ QQuickCanvas::~QQuickCanvas() QQuickItemPrivate *rootItemPrivate = QQuickItemPrivate::get(d->rootItem); rootItemPrivate->removeFromDirtyList(); + QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete d->incubationController; d->incubationController = 0; delete d->rootItem; d->rootItem = 0; |