summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 10b9fab..32ba2c3 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -100,6 +100,9 @@ QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type
if (!object)
return newObject(scriptEngine, this, new ObjectData(object, type));
+ if (QObjectPrivate::get(object)->wasDeleted)
+ return scriptEngine->undefinedValue();
+
QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, true);
if (!ddata) {