Priority: P3: Somewhat important
Affects Version/s: 5.15
Fix Version/s: 5.15.1
Component/s: Widgets: GraphicsView
Commits:6a90078d6bfe7900b6c9a6ea8c758172c7bc241f (qt/qtbase/dev) 31d7252d1c8d7fd7430903460e4093234f469e1a (qt/qtbase/5.15)
AnchorVertex is subclassed by AnchorVertexPair, which adds non-POD data members, resulting in the compiler generating a default destructor.
AnchorVertexPair objects are allocated with operator new and upcast when placed into QList<AnchorVertex*>, for instance in calls to replaceVertex. Deletion of those instances is then done via qDeleteAll on the lists, or otherwise primarily by deleting AnchorVertex pointers. There is only a single case where a AnchorVertexPair* is deleted, and no case where the type of the instance is checked (via the m_type member) before deleting instances.
This makes it very likely that there are memory leaks, as deleting an AnchorVertexPair instance through a AnchorVertex* will not call the generated ~AnchorVertexPair destructor.
Coverity ID 218707
|For Gerrit Dashboard: QTBUG-84094|
|299757,3||Fix potential memory leak by adding a virtual destructor to AnchorVertex||dev||qt/qtbase||Status: MERGED||+2||0|
|301013,2||Fix potential memory leak by adding a virtual destructor to AnchorVertex||5.15||qt/qtbase||Status: MERGED||+2||0|