Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4.0
-
None
-
-
eed2ee69a (dev), 1f6b5f1d4 (6.6), 1001b385f (6.5)
Description
Running a loop which does the following demonstrates a memory leak:
1. QFontDatabase::removeAllApplicationFonts()
2. QFontDatabase::addApplicationFont(font1);
3. Set font1 on Text element
4. QFontDatabase::removeAllApplicationFonts()
5. QFontDatabase::addApplicationFont(font2);
6. Set font2 on Text element
One issue is that isActive() on the distance field cache will never return false because for some reason not all glyphs are dereferenced. This should not cause any leak in this case however, since it will just mean the glyph cache is reused the next time the font is loaded. In fact, it is how all distance field glyph caches were handled prior to Qt 6.4.0 (they were never released)
The leak is also observable (and even larger) with NativeRendering, which indicates that we are actually leaking QFontEngines (which in turn contain glyph caches in the case of NativeRendering, so the impact would be greater).
Attachments
For Gerrit Dashboard: QTBUG-113714 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
485026,2 | Fix memory leak when invalidating NativeRendering fonts | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
485602,2 | Fix memory leak when invalidating NativeRendering fonts | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
485603,3 | Fix memory leak when invalidating NativeRendering fonts | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |