aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@jollamobile.com>2014-08-09 22:01:08 +1000
committerRobin Burchell <robin.burchell@viroteck.net>2014-08-11 13:03:19 +0200
commit01c6af3fc940378e8eee41a9fb8273420ef5a7e1 (patch)
tree6cf3a1a4a060899837a75268654fa8ee9026a910 /src/qml/qml/qqmlincubator.cpp
parente823bb5aee09c8a9f4a11bfd9ab6c68d2a77e93e (diff)
Avoid double deletion when deleting an incubating component.
The guard in QQmlIncubatorPrivate::clear() was invalidated by clearing the guards in QQmlIncubatorPrivate::incubate() when a deletion was detected. If we detect a deletion, leave the guards in place, to be handled in QQmlIncubatorPrivate::clear(). Task-number: QTBUG-40685 Change-Id: I1bf7422fda97745f1f7a3b42285a399244c09a1f Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r--src/qml/qml/qqmlincubator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 4cdeb19719..098a664ded 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -292,10 +292,7 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i)
QQmlEngine *engine = compiledData->engine;
QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine);
- bool guardOk = vmeGuard.isOK();
- vmeGuard.clear();
-
- if (!guardOk) {
+ if (!vmeGuard.isOK()) {
QQmlError error;
error.setUrl(compiledData->url);
error.setDescription(QQmlComponent::tr("Object destroyed during incubation"));
@@ -305,6 +302,8 @@ void QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt &i)
goto finishIncubate;
}
+ vmeGuard.clear();
+
if (progress == QQmlIncubatorPrivate::Execute) {
enginePriv->referenceScarceResources();
QObject *tresult = 0;