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

Signals not disconnected when target object is destroyed

    XMLWordPrintable

Details

    Description

      It is possible to get a function called on an object after it is deleted. This occurs when the function was connected to a signal using the .connect function. Then the signal will continue to call the function after the function's object is deleted. The function is still around, but references to the object it was on are invalidated (usually making it worthless). Since this is more analogous to a slot on a QObject than a JS function on a JS object, it should probably disconnect and clean up the function as well when the object is destroyed.

      This does not occur when the Connections element is used inside the dynamic object, only when a .connect is used to connect to a QML-defined slot on the dynamic object

      Attachments

        1. signalZombie.tgz
          0.6 kB
          Alan Alpert

        Activity

          People

            qtqmlteam Qt Qml Team User
            aalpert Alan Alpert
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: