-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.4, 6.9.1, 6.10.0 Beta2
-
None
-
Windows 10 22H2, MSVC 2022 x64
-
4e3f3ace8 (tqtc/lts-6.8), e0d4577a1 (tqtc/lts-6.8), 7215bf804 (tqtc/lts-6.8), 3ad626b87 (tqtc/lts-6.8), 2bebb36d2 (tqtc/lts-6.8), e728b35eb (tqtc/lts-6.8), e0f65fe66 (dev), 04f069e4d (6.10), dd41fe2fa (6.9), f49b7a073 (tqtc/lts-6.8)
Based on the example from QTBUG-138919/QTBUG-138944. CppObj is a QML_ELEMENT while CppBridge is a QML_SINGLETON.
Code
import QtQuick import JSOwnershipStudy Window { width: 400 height: 300 visible: true property list<CppObj> listProp: CppBridge.multipleObjsFrom( 0) // IDs 0 -- 99 property var varProp: CppBridge.multipleObjsFrom(100) // IDs 100 -- 199 }
Steps to reproduce
Run and quit the example
Outcomes when quitting the example
- (All versions) The objects stored in listProp are destroyed upon quitting (Expected)
- (Qt 6.5) The objects stored in varProp are destroyed upon quitting (Expected)
- (Qt 6.8+) The objects stored in varProp are never destroyed (Not Expected)
The workaround for QTBUG-138919 suggested by Luca Di Sera (setting QML_DISABLE_DISK_CACHE=1) does not work here.
- relates to
-
QTBUG-138919 [Reg 6.5.9 -> 6.8.4] Unreferenced objects with JavaScriptOwnership are no longer destroyed
-
- Closed
-
-
QTBUG-139059 Generated code does not track objects on JavaScript stack
-
- Closed
-
- resulted in
-
QTBUG-139053 Re-design transfer of QObject ownership to JavaScript
-
- Open
-
- split from
-
QTBUG-138944 List of objects with JavaScriptOwnership are not ref-counted correctly when assigned to ListView.model
-
- Closed
-