diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-19 13:39:10 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-20 11:06:40 +0000 |
commit | 69d76d59cec0dcff4c52eef24e779fbef14beeca (patch) | |
tree | 506a08df8d801b6ab94ae4b6bf47629a44a2e402 /src/qml/jsruntime | |
parent | 5cfccf30898aed5ca96c0f8779b0f8a1117118b7 (diff) |
V4: Don't mark InternalClass::parent when garbage collecting
The parent pointer is only kept so that we can update the parent's
transitions when removing a child. There is no need to keep the parents
alive for the children.
Fixes: QTBUG-58559
Change-Id: Ia28183966bde6d478ca030fe11195489925dfc13
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4internalclass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index ddb8542e07..9906e2b1a0 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -257,11 +257,15 @@ void InternalClass::init(Heap::InternalClass *other) void InternalClass::destroy() { -#ifndef QT_NO_DEBUG for (const auto &t : transitions) { - Q_ASSERT(!t.lookup || !t.lookup->isMarked()); - } + if (t.lookup) { +#ifndef QT_NO_DEBUG + Q_ASSERT(t.lookup->parent == this); #endif + t.lookup->parent = nullptr; + } + } + if (parent && parent->engine && parent->isMarked()) parent->removeChildEntry(this); @@ -659,8 +663,6 @@ void InternalClass::markObjects(Heap::Base *b, MarkStack *stack) Heap::InternalClass *ic = static_cast<Heap::InternalClass *>(b); if (ic->prototype) ic->prototype->mark(stack); - if (ic->parent) - ic->parent->mark(stack); ic->nameMap.mark(stack); } |