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

QGraphicsItemPrivate::extras is memory-unsafe

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • None
    • None

      In particular, the ExtraCacheData is storing a heap-allocated object in a QVariant that anyone with access to the private API can unsetExtra() at any time, without going through removeExtraItemCache(). This is pretty brittle, and you can't fault Coverity complaining about finding potential paths that would leak the cache object.

      This flexibility is really over-engineered. extras should just be a unique_ptr to a struct with field of concrete types, not QVariant, and

      • the ExtraCacheData should be held in a unique_ptr in there
      • ExtraToolTip as a QString
      • etc

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

            hatemelkharashy Hatem ElKharashy
            mmutz Marc Mutz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes