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

QGraphicsItemPrivate::extras is memory-unsafe

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes