diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-17 07:22:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-17 07:22:32 (GMT) |
commit | af810e444ee73b112623128a3637b28b81f3f2fb (patch) | |
tree | 6bcf379115845f3bc6bd0fde6a2c74ffa320f92b /src | |
parent | 4631d297781b8ad4eba0735b7023265d4872c1cb (diff) | |
parent | a3b7438be516c44a5d1ebba91445164f0b64dd37 (diff) | |
download | Qt-af810e444ee73b112623128a3637b28b81f3f2fb.zip Qt-af810e444ee73b112623128a3637b28b81f3f2fb.tar.gz Qt-af810e444ee73b112623128a3637b28b81f3f2fb.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Autotest for QVariant value types
Fix memory leak
Clarify Component.createObject(null) behavior.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index e2cbdcf..f716f85 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -627,6 +627,10 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent} property, or else the object will not be visible. + If a \a parent is not provided to createObject(), a reference to the returned object must be held so that + it is not destroyed by the garbage collector. This is regardless of Item.parent being set afterwards, + since setting the Item parent does not change object ownership; only the graphical parent is changed. + Dynamically created instances can be deleted with the \c destroy() method. See \l {Dynamic Object Management in QML} for more information. */ diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 6d49625..fb07bef 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -938,8 +938,13 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, if (bindValues.count) ep->bindValues << bindValues; + else if (bindValues.values) + bindValues.clear(); + if (parserStatus.count) ep->parserStatus << parserStatus; + else if (parserStatus.values) + parserStatus.clear(); Q_ASSERT(stack.count() == 1); return stack.top(); |