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

ChangeListeners get called even after being semi-deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • None
    • 6.2
    • None
    • 098231ae3 (dev), 7481dff31 (dev), 9829dbd77 (dev), 06c8d07c8 (6.5), 53c0eed98 (6.5), 32d78022a (6.5), a6c8de278 (dev)

      Due to various issues, we call change listeners on objects for which QQmlData::wasDeleted returns true (or rather, calling it on the the private's q_ptr, when we have a QObjectPrivate inheriting from ChangeListener). This can be uncovered by adding a check for this condition (like in https://codereview.qt-project.org/c/qt/qtdeclarative/+/383975), and triggering an assert or printing a warning.  Then simply run a test which covers large parts of Quick and Controls, like tst_basic or tst_fusion

       

      Incomplete list of those issues:

      • QQuickItem's dtor, we call setParentItem(nullptr) on all child items. The child items then do (basically) parent->removeChild(child) (note that parent is currently getting destroyed). And removeChild causes an itemChange

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

            vhilshei Volker Hilsheimer
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: