diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-03-13 13:30:39 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-15 02:44:40 +0100 |
commit | 25793276e52240e4dfad297dc5b9eb282ed3f5e6 (patch) | |
tree | 2c28122e886334703cd3f6cdd17cba759209b313 /src/qml/qml/qqmlvmemetaobject_p.h | |
parent | 147247a31a9d6c1edadb0c7c78cf10b894dfab25 (diff) |
Fix crash caused by dereferencing collected v8 data
If a var property of a QObject is read after the v8 data associated
with the qobject has been deleted but prior to the DeferredDelete
event being processed, the varProperties array will be null and
a crash will occur.
This patch ensures that we check for this condition in both the
access and set codepaths for var properties, and also ensures
that an object which has previously been queued for deletion cannot
be referenced in JS.
Finally, it adds a unit test to ensure that we don't regress.
Task-number: QTBUG-24748
Change-Id: Idde384ca01e18f4dcf9e376e9379f2c5eb410e14
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject_p.h')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index 84c88fdd7b..1b5ceb8203 100644 --- a/src/qml/qml/qqmlvmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -195,7 +195,7 @@ private: static void VarPropertiesWeakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter); static void GcPrologueCallback(QV8GCCallback::Node *node); inline void allocateVarPropertiesArray(); - inline void ensureVarPropertiesAllocated(); + inline bool ensureVarPropertiesAllocated(); void connectAlias(int aliasId); QBitArray aConnected; |