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

Unqualified lookup in component root scope causes memory leak

    XMLWordPrintable

    Details

    • Commits:
      fcae2d13e43eab1ea60092194667939f85269bde (qt/qtdeclarative/5.14)

      Description

      main.qml:

      import QtQml 2.0
      
      QtObject {
          property int a: 6
          property QtObject obj1: QtObject {
              Component.onCompleted: console.log(a)
          }
      }
      

      main.cpp:

      #include <QCoreApplication>
      #include <QQmlEngine>
      #include <QQmlComponent>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication app(argc, argv);
          QQmlEngine engine;
      
          QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/main.qml")));
          QObject *object = component.create();
          delete object;
      
          return 0;
      }
      

      This leaks a large number of QQmlPropertyCache entries. Qualifying the lookup of 'a' prevents the leak.

        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:
              ulherman Ulf Hermann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes