Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-139025

[Reg 6.5.9 -> 6.8.4] Lists of objects with JavaScriptOwnership, stored in var properties, are no longer destroyed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • 6.8, 6.11
    • 6.8.4, 6.9.1, 6.10.0 Beta2
    • None
    • Windows 10 22H2, MSVC 2022 x64
    • 88adccfae (tqtc/lts-6.8), 44a9caffe (tqtc/lts-6.8), 4775329a2 (tqtc/lts-6.8), 984a4669a (tqtc/lts-6.8), 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)

      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.

        For Gerrit Dashboard: QTBUG-139025
        # Subject Branch Project Status CR V

            ulherman Ulf Hermann
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change