aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-05-29 14:58:52 +0200
committerLars Knoll <lars.knoll@digia.com>2013-05-31 10:29:41 +0200
commitc220a6f0ff9a4f3f80830806d0ddeb0115c6838d (patch)
treed372ead3eb8843b118e0de82dfe938ffca2d4b32 /src/qml/qml/qqmlvmemetaobject.cpp
parent992cf583d4c559027206ef570d623eda95a0ffa3 (diff)
Fix tst_qqmlecmascript::jsOwnedObjectsDeletedOnEngineDestroy
When destructing the JS engine and deleting the JS wrappers, we may decide to delete the QObjects of JS owned JS QObject wrappers. During this phase (engine destruction) we need to delete the QObject instantly instead of deferred (the default when _running_ the engine). * Delete the memory manager first in the ExecutionEngine destructor, as some of the user code destructors we may end up calling still expect a somewhat functioning engine unfortunately. * Fixed also some bugs in Persistent/WeakValue: When assing a value, detach properly if refcount > 0 * Fixed a bug when clearing a weak value during sweep, when we wouldn't pick up the correct next pointer for a weak value that didn't have the mark bit set Change-Id: I960e58ecbb40b0ecf2bc07fe661a1ec706fcca61 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index ace9ff9a65..09edd3af89 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -73,7 +73,8 @@ void QQmlVMEVariantQObjectPtr::objectDestroyed(QObject *)
if (m_isVar && m_target->varPropertiesInitialized && !m_target->varProperties.isEmpty()) {
// Set the var property to NULL
QV4::ArrayObject *a = m_target->varProperties.value().asArrayObject();
- a->putIndexed(m_index - m_target->firstVarPropertyIndex, QV4::Value::nullValue());
+ if (a)
+ a->putIndexed(m_index - m_target->firstVarPropertyIndex, QV4::Value::nullValue());
}
m_target->activate(m_target->object, m_target->methodOffset() + m_index, 0);