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

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

      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())

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

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

              Created:
              Updated:

                There are no open Gerrit changes