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

Ownership of C++ owned object flips when added to ListModel

    XMLWordPrintable

Details

    • 219ca3bf2be65fb4f1741bdc7b53d6dc4a41dd31 (qt/qtdeclarative/dev) 784aad8fd0387e11297cd27ed814e875dc5f914b (qt/qtdeclarative/6.2), 718f3469f (dev), 749470e6b (tqtc/lts-6.2), 389110675 (6.5), a22ea1619 (6.4)

    Description

      Suppose an object is created in C++ and its ownership is set to CppOwnership explicitly by QJSEngine::setObjectOwnership(). 

      Once it is referenced by a list element and its invocable method is called by QML engine, then its ownership turns to JavaScriptOwnership.

      I made an autotest that reproduces the issue.

      https://codereview.qt-project.org/c/qt/qtdeclarative/+/368105

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              jaeyoon.jung Jaeyoon Jung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: