Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71036 Qt Core Changes in Qt 6
  3. QTBUG-79401

qvariant: Avoid dangling QObject pointers

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Fix Version/s: 6.0
    • Component/s: Core: Object Model
    • Labels:
      None
    • Platform/s:
      All

      Description

      When storing a QObject pointer or a QObject-subclass pointer in a QVariant, the raw pointer is stored in QVariant's QObject *Data::o member. Numerous times in the past this has caused crashes in user code when the pointer became dangling.

      We should consider making QVariant safe by defaulting to supporting a weak reference.

      Unfortunately, this cannot be done in Qt 5 without breaking binary compatibility.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              shausman Simon Hausmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes