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

Qt Crashes Crashes since it does not clear the references in ~QObject

XMLWordPrintable

      Given two widgets P and C, where C is a child of P, the following sequence is possible:
      1. ~QWidget of P calls clearGuards.
      2. ~QWidget of P calls deleteChildren, deleting C.
      3. ~QWidget of C calls clearFocus, causing QApplication to emit focusChanged.
      4. Some other object receives focusChanged and somehow gets hold of P (see below). It uses a QPointer to remember P.
      5. ~QObject of P skips clearGuards, because P has been a QWidget.
      6. The deletion of P completes.

      And this causes a crash. Code is attached.

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

            markan Marko Kangas
            thwijeth Tharanga Wijethilake (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes