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

Create a warning when object gets deleted while it is doing a signal emission

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Object Model
    • None

    Description

      I've seen several crashes related to this in user code, e.g.:

      • Code deleted a QLocalSocket in a slot connected to the QLocalSocket's readChannelFinished().
      • Similar situations often arise with QNetworkReply and its finished() signal.

      Maybe we can have some code that is only enabled in debug mode that warns the user and suggests deleteLater(), e.g.:
      Q_WARN_IF_DELETED_IN_SIGNAL_EMISSION(QNetworkReply, SIGNAL(finished())

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              mgoetz Markus Goetz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes