Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.4, 4.8.0
-
None
-
Windows
-
8960f7356796948b161159cff404a9ebd1624c5f
Description
Our application sometimes crashes when using cached fonts after exporting a PDF, because a font engine that is in the cache has been deleted. I tried to reproduce this in a smaller test case, but unfortunately couldn't - however we have a 100% reproducible case in our application.
Exporting a PDF (or EPS) file with QPrinter uses a QFontSubset when embedding fonts. The destructor of this class deletes its QFontEngine if the reference count is zero, but it doesn't check the cache count. I think this is the problem - there's nothing stopping the font engine from being destroyed when it's still stored in the cache.
The fix should be simple: just add a check for cache_count == 0 in the QFontSubset destructor, before the font engine is destroyed.
Attachments
Issue Links
- is required for
-
QTBUG-25378 QtPrintSupport - Font Issues
- Open
For Gerrit Dashboard: QTBUG-22942 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
104552,7 | Added check if fontEngine is still in the cache. | 4.8 | qt/qt | Status: MERGED | +2 | 0 |