diff options
author | Jian Liang <jianliang79@gmail.com> | 2015-12-25 21:36:46 +0800 |
---|---|---|
committer | jian liang <jianliang79@gmail.com> | 2016-01-22 14:07:19 +0000 |
commit | 3cc589c98390992e3ee8a7970dc2913ea857d623 (patch) | |
tree | 6c058e0bcd2c31661d370e7baed66d4cffaae32a /src/qml/jsruntime/qv4persistent_p.h | |
parent | 2d7921184e86c9dcd4189bd7da79b3fa050abedc (diff) |
Make sure we destroy all QV4::QObjectWrapper objects
Delay freeing QObjectWrapper Value to MemoryManager::sweep() to make sure
we can destroy all QObjectWrapper objects.
We also keep track of QObjectWrapper in QV4::Heap::ModelObject to make
sure we destory them in QV4::MemoryManager::sweep()
Change-Id: I3a8a3b07faab1f88c2eb746f68aa8d9584b40026
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4persistent_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4persistent_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h index 80b4ecdea8..6345c9cc3d 100644 --- a/src/qml/jsruntime/qv4persistent_p.h +++ b/src/qml/jsruntime/qv4persistent_p.h @@ -178,15 +178,15 @@ public: bool isUndefined() const { return !val || val->isUndefined(); } bool isNullOrUndefined() const { return !val || val->isNullOrUndefined(); } - void clear() { - PersistentValueStorage::free(val); - val = 0; - } + void clear() { free(); } void markOnce(ExecutionEngine *e); private: Value *val; + +private: + void free(); }; } // namespace QV4 |