aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-18 14:56:25 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-20 13:26:17 +0200
commit2d4f2b3e758df0e9bafaa9b3adea7f4d5c19ae2b (patch)
tree6a35fda5fa8f0a1ec02cc319bd42a9fa9fd56b6e /src
parent3fe0716f608da26332625b98e724aad73f687993 (diff)
Allow QDeclarativeIncubator to be deleted within statusChanged() callback
Change-Id: I17621870b67d8a975545adc27ddaf9695e6a9428 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeincubator.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativeincubator.cpp b/src/declarative/qml/qdeclarativeincubator.cpp
index d1afac2d13..05c73da3a2 100644
--- a/src/declarative/qml/qdeclarativeincubator.cpp
+++ b/src/declarative/qml/qdeclarativeincubator.cpp
@@ -83,15 +83,22 @@ void QDeclarativeEnginePrivate::incubate(QDeclarativeIncubator &i, QDeclarativeC
inProgressCreations++;
- p->changeStatus(QDeclarativeIncubator::Loading);
-
if (mode == QDeclarativeIncubator::Synchronous) {
- QDeclarativeVME::Interrupt i;
- p->incubate(i);
+ typedef QDeclarativeIncubatorPrivate IP;
+ QRecursionWatcher<IP, &IP::recursion> watcher(p);
+
+ p->changeStatus(QDeclarativeIncubator::Loading);
+
+ if (!watcher.hasRecursed()) {
+ QDeclarativeVME::Interrupt i;
+ p->incubate(i);
+ }
} else {
incubatorList.insert(p);
incubatorCount++;
+ p->changeStatus(QDeclarativeIncubator::Loading);
+
if (incubationController)
incubationController->incubatingObjectCountChanged(incubatorCount);
}