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

If garbage collector runs during QML object creation, var properties break

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.0.2
    • 5.0.0
    • None
    • Ubuntu 10.04.2 LTS; Qt 5.0.0 built from qt-everywhere-opensource-src-5.0.0.tar.gz
    • d005c5c80b6fff835adb350a780d80348549bc64

    Description

      If the garbage collector runs while a QML object is being created, then the var properties of that object become unusable. They cannot be directly referenced and always have a value of undefined, even after being assigned a different value.

      The attached example achieves this by forcing garbage collection in an on*Changed handler, but it can happen by chance in long running applications. Run the attached example with "qmlscene bug01.qml". Only the console output of the example is interesting.

      I suspect it is related to QQmlVMEMetaObject's weak reference to the var properties array, but I don't know enough about the internals to fix it.

      Attachments

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

        Activity

          People

            chrisadams Christopher Adams
            jeff3548 Jeffrey B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes