diff options
author | Jian Liang <jianliang79@gmail.com> | 2015-11-18 22:30:26 +0800 |
---|---|---|
committer | jian liang <jianliang79@gmail.com> | 2015-12-18 15:52:43 +0000 |
commit | 839d2d3e2368bc8e107d22203b0611c852f54319 (patch) | |
tree | 6ea5f2b5bb5fca87e37872352f24c85649589ac2 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | 4b018848f7a7055976895de8a4b8208b58a36fac (diff) |
Fix QtSharedPointer::ExternalRefCountData object leaks
Call destroyObject() for every QV4::Heap::QObectWrapper object in heap in
QV4::MemoryManager::sweep() to make sure the QPointer object contained in
QV4::Heap::QObjectWrapper is properly destructed.
We also keep track of QObjectWrapper in QV4::Heap::ModelObject to make
sure we destory them in QV4::MemoryManager::sweep()
Change-Id: I3b3e96cfc300c2e21ab691762879ac2970afa90c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 8f471132b7..2cb8991055 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1019,6 +1019,11 @@ void QObjectWrapper::markObjects(Heap::Base *that, QV4::ExecutionEngine *e) void QObjectWrapper::destroyObject(bool lastCall) { Heap::QObjectWrapper *h = d(); + destroyObject(h, lastCall); +} + +void QObjectWrapper::destroyObject(Heap::QObjectWrapper *h, bool lastCall) +{ if (!h->internalClass) return; // destroyObject already got called |