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

    • 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.

        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:
              Resolved:

                There are no open Gerrit changes