aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r--src/quick/items/qquickloader.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index 414103c63e..d5601292b7 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -98,6 +98,12 @@ void QQuickLoaderPrivate::clear()
delete itemContext;
itemContext = 0;
+ // Prevent any bindings from running while waiting for deletion. Without
+ // this we may get transient errors from use of 'parent', for example.
+ QQmlContext *context = qmlContext(object);
+ if (context)
+ QQmlContextData::get(context)->invalidate();
+
if (loadingFromSource && component) {
// disconnect since we deleteLater
QObject::disconnect(component, SIGNAL(statusChanged(QQmlComponent::Status)),
@@ -353,6 +359,12 @@ void QQuickLoader::setActive(bool newVal)
d->itemContext = 0;
}
+ // Prevent any bindings from running while waiting for deletion. Without
+ // this we may get transient errors from use of 'parent', for example.
+ QQmlContext *context = qmlContext(d->object);
+ if (context)
+ QQmlContextData::get(context)->invalidate();
+
if (d->item) {
QQuickItemPrivate *p = QQuickItemPrivate::get(d->item);
p->removeItemChangeListener(d, watchedChanges);