summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-05-04 10:57:03 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-05-04 10:57:03 (GMT)
commitf82a929a9f896b73e25b06f5eb4cf1a313dce60a (patch)
tree16360b1f09e659705dd7af7d7fb42cac39b6b98c /src
parenta5aadcea4c12c7926bf3b4d218ce476723cd7e10 (diff)
downloadQt-f82a929a9f896b73e25b06f5eb4cf1a313dce60a.zip
Qt-f82a929a9f896b73e25b06f5eb4cf1a313dce60a.tar.gz
Qt-f82a929a9f896b73e25b06f5eb4cf1a313dce60a.tar.bz2
Allow dynamic deletion of objects created with createQmlObject
Task-number: QTBUG-10328
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index dee5ec6..d31e3d5 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1029,7 +1029,10 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
if (!component.isReady())
return ctxt->throwError("Qt.createQmlObject(): Component is not ready");
- QObject *obj = component.create(context->asQDeclarativeContext());
+ QObject *obj = component.beginCreate(context->asQDeclarativeContext());
+ if(obj)
+ QDeclarativeData::get(obj, true)->setImplicitDestructible();
+ component.completeCreate();
if(component.isError()) {
QList<QDeclarativeError> errors = component.errors();