aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 6efe2a8597..4849886ff9 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -859,8 +859,9 @@ ExecutionEngine::~ExecutionEngine()
delete identifierTable;
delete memoryManager;
+ // Take a temporary reference to the CU so that it doesn't disappear during unlinking.
while (!compilationUnits.isEmpty())
- (*compilationUnits.begin())->unlink();
+ QQmlRefPointer<ExecutableCompilationUnit>(*compilationUnits.begin())->unlink();
delete bumperPointerAllocator;
delete regExpCache;