aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-15 11:45:04 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-23 07:43:38 +0000
commitba6371fb2ae3ad0096ec672f61a7a989c297d8fc (patch)
treed29cc9c7e13d4320c8a5e1ff9c4068933ff276e5 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parentfeb9ace3de30170f785217fdb7c454e92ca6d525 (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 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 085cd5ffd0..788ecce1c5 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -7550,7 +7550,8 @@ public:
private slots:
void reviveFirstWeakReference() {
- *resultPtr = weakRef->valueRef() && weakRef->isNullOrUndefined();
+ // weakRef is not required to be undefined here. The gc can clear it later.
+ *resultPtr = weakRef->valueRef();
if (!*resultPtr)
return;
QV4::ExecutionEngine *v4 = qmlEngine(this)->handle();