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

QSharedPointer works incorrectly

    XMLWordPrintable

Details

    • 943d63e45ad09f75daa7d2f3dcc17bb28fda1766

    Description

      I have found interesting issue. I attached file to description.
      This code crashes. In object B i have destructor:

      ~B()
      {
      	QSharedPointer<IB> b = m_a->getB();
      }
      

      When i destroy object B, reference to object becames 0. In B destructor reference became 1 and when we leave destructor reference became 0 and QSharedPointer make attempt to delete object again.
      Note: boost::shared_pointer solves this situation correctly.

      Attachments

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

        Activity

          People

            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            hsilgos Khnykin Evgeniy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes