-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.10.0 Beta2
Coverity complains (at least CID 487585, but very probably more) about the guarded deletion of the result of loadGlyphFor(). Indeed, while most functions use the same condition for the deletion, QFontEngineFT::glyphData() does not, in its return nullptr branch.
Suggest to port the code from raw pointers to some form of unique_ptr, maybe with a deleter that contains a bool needsDeletion, set to the ever-repeated !cacheEnabled && get() != &emptyGlyph at construction.
Without this, there are so many questions about this code, like is the condition in QFontEngineFT::glyphData() equivalent to the condition in the other users? Or what happens if cacheEnabled changes between the creation of the Glyph and its destruction? Can it?
Not least, it would DRY the repeated guarded deletes strewn over the code.