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

Memory leak while accessing a C++ Object in QML with JavaScriptOwnership

    XMLWordPrintable

    Details

      Description

      When an Object with JavaScriptOwnership is accessed in QML, it results in a memory leak.
      Please refer to the sample attached, you can see the Foo's destructor is not called. If any of the commented lines is commented, it works fine.

          Bar{
              id: bar
      // Assigning myFoo.counter solves the issue
      //        property int name: myFoo.counter
      
              myFoo.counter:7
      
      // Printing myFoo.counter solves the issue
      //        Component.onCompleted: console.log(myFoo.counter)
      
          }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            shmittal Shveta Mittal (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes