diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-08-15 10:01:59 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-08-21 20:33:23 +0200 |
| commit | 2547e8be4d507361527d422184d3cae205aa76ff (patch) | |
| tree | ce5c1ec11b862ac0a5fdb67e7158fb5e15342a7c /src/qml/jsruntime/qv4engine.cpp | |
| parent | e0b9c581b815996ce1b278e3cb5fd94ab5489f8d (diff) | |
QtQml: Store detached VariantAssociation objects on the JS heap
While the VariantAssociation is detached it is subject to the GC or
unrelated C++ code deleting objects from its internals. Since it's then
not the owning object's responsibility to track this anymore, we need to
track it ourselves. The way to do it is to use the existing V4 objects.
Pick-to: 6.10 6.9
Task-number: QTBUG-139025
Change-Id: Ic1d5aa85171b5d91c2b9d546963268b6f09c2802
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index c963d6689b..334148f79c 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1589,8 +1589,6 @@ static QVariant toVariant(const QV4::Value &value, QMetaType metaType, JSToQVari // Otherwise produce the "natural" type of the sequence. return QV4::SequencePrototype::toVariant(s); } else if (auto association = object->as<QV4::VariantAssociationObject>()) { - if (conversionBehavior == JSToQVariantConversionBehavior::Never) - return QVariant::fromValue(QJSValuePrivate::fromReturnedValue(association->asReturnedValue())); return association->d()->toVariant(); } } |
