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

Component.onDestruction causes crashes

    XMLWordPrintable

Details

    Description

      import QtQuick 2.2
      
      QtObject {
          id: root
      
          property Component component: QtObject {
              // The component must have an inner object to trigger the crash.
              property var innerObject: QtObject {
                  // The inner object must have an onDestruction handler to trigger the crash.
                  Component.onDestruction: {}
              }
          }
      
          property Timer timer: Timer {
              interval: 10
              running: true
              repeat: true
              property real count
      
              onTriggered: {
                  console.log("Iteration " + (++count));
      
                  // Note: if these objects are parented to something (such as root), there's no crash.
                  component.createObject();
      
                  // Calling gc() explicitly triggers the crash more quickly, but it also crashes
                  // if the gc is invoked automatically.
                  gc();
              }
          }
      }
      

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            shausman Simon Hausmann
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes