aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-02-20 16:03:35 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2024-03-05 14:06:29 +0100
commitb871644b31a5fc1f410e0759f0b51f5418dc8f34 (patch)
treecc3ef154a6e52b34785d17649b8d6e2471549e72 /src/qml/qml/qqmlvmemetaobject.cpp
parent970828df9c134859d3ceb352e53374c94d1eeb07 (diff)
Prepare for white allocations (7/9): QQuick(Window|View)
Prevent QObjectWrapper from being gced - if we use white alloctations, and the weak values have already been marked, then nothing will mark the newly created QObjectWrapper. Use a helper function which takes care of the marking, and call it in the appropriate places. Also mark the normal wrap and wrapConst functions as [[nodiscard]] to avoid this issue from resurfacing in the future, and adjust a few call-sites to also call ensureWrapper. Change-Id: I8d4c73ae62b61d21b1456a3b096fc6a42f302160 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 4a2c1c810c..5f3b6975ca 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -1394,7 +1394,7 @@ void QQmlVMEMetaObject::setVMEProperty(int index, const QV4::Value &v)
void QQmlVMEMetaObject::ensureQObjectWrapper()
{
Q_ASSERT(cache);
- QV4::QObjectWrapper::wrap(engine, object);
+ QV4::QObjectWrapper::ensureWrapper(engine, object);
}
void QQmlVMEMetaObject::mark(QV4::MarkStack *markStack)