diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-01-15 11:45:04 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-01-23 07:43:38 +0000 |
commit | ba6371fb2ae3ad0096ec672f61a7a989c297d8fc (patch) | |
tree | d29cc9c7e13d4320c8a5e1ff9c4068933ff276e5 /src/qml/memory/qv4mm.cpp | |
parent | feb9ace3de30170f785217fdb7c454e92ca6d525 (diff) |
MemoryManager: Only clear weak values once
We want to keep the weak values alive while the destruction callbacks
are running, so that they can still access them. We set them to
undefined later anyway because we expect the destruction callbacks to
mess with the values. Therefore there is no point in also setting them
in between.
Fixes: QTBUG-72137
Change-Id: I83f70230f5b4ad2761c74770f975b14a5ca71f18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/memory/qv4mm.cpp')
-rw-r--r-- | src/qml/memory/qv4mm.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 97254b9172..3cf22d82e5 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -973,8 +973,6 @@ void MemoryManager::sweep(bool lastSweep, ClassDestroyStatsCallback classCountPt // signal before we start sweeping the heap if (QObjectWrapper *qobjectWrapper = (*it).as<QObjectWrapper>()) qobjectWrapper->destroyObject(lastSweep); - - (*it) = Value::undefinedValue(); } // remove objects from weak maps and sets |