Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
5.0.0
-
None
Description
These two code paths were altered so they never delete the font engines, as the QFontCache will handle the garbage collection later.
While this won't cause leaks in practice, it's different from how the references are handled in other locations in Qt, where the QFontEngine will be deleted when the reference count hits 0 if it is not present in a cache. If we don't use the same logic in QtSceneGraph, we leave ourselves open for bugs in the future, if someone decides to rely on the implicit contract.
We should fix this by checking cache_count when there are no more references and delete the object if it is also zero.