aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-28 13:04:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 13:28:46 +0100
commita0f82509e47ca2b8bf625cd40b83f6582a714dce (patch)
tree9575084b101752f5adf2da4f0c4c7bc6dae1db8b /src/qml/jsruntime
parent902e73e02d34b3739c74e758234ddc78893b1711 (diff)
Fix double deletion
Small regression from commit 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510. Processing the deletables might result in the onDestruction emission, which in turn may end up in GC allocation and thus GC runs. That in turn may result in m_deletables processing, which at this point is nested then. For that to work we need to set m_deletables back to zero _before_ beginning with the iteration. Fixes tst_qqmlecmascript with aggressive gc. Change-Id: Ibb310b30cd496644557f4c1bb23318b18ee8f36c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4mm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index 8a255e1bad..5a1e8b0821 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -364,13 +364,13 @@ void MemoryManager::sweep(bool lastSweep)
}
GCDeletable *deletable = m_d->deletable;
+ m_d->deletable = 0;
while (deletable) {
GCDeletable *next = deletable->next;
deletable->lastCall = lastSweep;
delete deletable;
deletable = next;
}
- m_d->deletable = 0;
}
void MemoryManager::sweep(char *chunkStart, std::size_t chunkSize, size_t size)