diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-11 01:56:34 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-11 01:56:34 (GMT) |
commit | 5c69031b23f349d199ed43e484a608a2b691bb95 (patch) | |
tree | 58ab03fddc0df3416c2740231c04a823e677cf41 /src/declarative/qml/qmlcontext.cpp | |
parent | 97383f0f253a3696dd9a75338aa7d263b05526e1 (diff) | |
download | Qt-5c69031b23f349d199ed43e484a608a2b691bb95.zip Qt-5c69031b23f349d199ed43e484a608a2b691bb95.tar.gz Qt-5c69031b23f349d199ed43e484a608a2b691bb95.tar.bz2 |
When a QmlContext is destroyed, associated objects must be disassociated
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index dfcf413..16399bc 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -231,6 +231,18 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent) */ QmlContext::~QmlContext() { + Q_D(QmlContext); + for(int ii = 0; ii < d->contextObjects.count(); ++ii) { + QObjectPrivate *p = QObjectPrivate::get(d->contextObjects.at(ii)); + QmlSimpleDeclarativeData *data = + static_cast<QmlSimpleDeclarativeData *>(p->declarativeData); + if(data && (data->flags & QmlSimpleDeclarativeData::Extended)) { + data->context = 0; + } else { + p->declarativeData = 0; + } + } + d->contextObjects.clear(); } |