aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qv8qobjectwrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/v8/qv8qobjectwrapper.cpp')
-rw-r--r--src/declarative/qml/v8/qv8qobjectwrapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp
index 2649976513..9481bb54fe 100644
--- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp
+++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp
@@ -861,6 +861,7 @@ static void WeakQObjectInstanceCallback(v8::Persistent<v8::Value> handle, void *
v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8Engine *engine)
{
Q_ASSERT(object);
+ Q_ASSERT(this->engine);
Q_ASSERT(QDeclarativeData::get(object, false));
Q_ASSERT(QDeclarativeData::get(object, false)->propertyCache == this);
@@ -938,6 +939,8 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8
ft->InstanceTemplate()->SetHasExternalResource(true);
constructor = qPersistentNew<v8::Function>(ft->GetFunction());
}
+
+ QDeclarativeCleanup::addToEngine(this->engine);
}
v8::Local<v8::Object> result = constructor->NewInstance();