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

The destroyed signal can be received by a deleted receiver

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 6.2.2
    • Fix Version/s: None
    • Component/s: Core: Object Model
    • Labels:
      None

      Description

      When a widget connects itself to the destroyed signal of a child widget using a functor, the slot code is called when the widget itself is destroyed and after its own destructor has been called. This does not happen when connecting using using the SIGNAL/SLOT macros.

      Sample project is included.

      To reproduce:

      1. Load and run the sample project in QtCreator. Note that the qFatal() call inĀ CustomTopWidget::wasDestroyed will be reached.
      2. ChangeĀ constexpr bool SHOW_BUG = true; to false and rerun. This time the qFatal will not be reached.

        Attachments

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

          Activity

            People

            Assignee:
            cnn Qt Core & Network
            Reporter:
            mjbishop Michael Bishop
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes