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

QSharedPointer won't take ownership of a QObject that has once had a parent if QT3_SUPPORT is defined

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.0
    • Core: Object Model
    • None
    • Windows 7 x64 - MSVC 2010 SP1 - cross-compile target=AMD64

    Description

      When building Qt 4.8.0 with QT3_SUPPORT and QT_SHAREDPOINTER_TRACK_POINTERS, the following program crashes.

      QWidget w1;
      QWidget *w2 = new QWidget(&w1);
      w2->setParent(nullptr);
      QSharedPointer<QWidget> sp(w2); // crash: QSharedPointer: pointer %p already has reference counting

      It looks like it is due to the QT3_SUPPORT-specific code in QObjectPrivate::setParent_helper(QObject *)

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            ccomparon Cyril C
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes