diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-09-19 09:32:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 14:27:39 +0200 |
commit | 57f7545f67d517d1c6cdbbf972db85cabe5ef8cf (patch) | |
tree | 1f1ad352bfeb18e0c895891013cd4d47ed9a15f8 /src/qml/jsruntime/qv4engine.cpp | |
parent | 064c2f8f0d97b97895ebc3ec2b5e2b1ff4c9f2b4 (diff) |
Fix destruction of QV4::CompiledData::CompilationUnit objects
Now that we store them per QML file, they live in the type cache and
can outlive the engine. Therefore the engine needs to free to unlink
any remaining units upon destruction. This needs to be done after the
"death" of the memory manager, which is likely to sweep away any
function objects that also hold a reference to the compilation units.
Change-Id: I3968d5995289e8d2bc1e3abbb1f8be88a0ab4e03
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 1a084905ae..daa58d5e81 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -296,6 +296,12 @@ ExecutionEngine::~ExecutionEngine() m_multiplyWrappedQObjects = 0; delete identifierTable; delete memoryManager; + + QSet<QV4::CompiledData::CompilationUnit*> remainingUnits; + qSwap(compilationUnits, remainingUnits); + foreach (QV4::CompiledData::CompilationUnit *unit, remainingUnits) + unit->unlink(); + delete m_qmlExtensions; emptyClass->destroy(); delete bumperPointerAllocator; |