fc: Clean up current config on shutdown
The FontConfig database had a static leak because we never dereferenced the current config. To make address sanitizer output less noisy, we clean this up on shutdown. From FcConfigDestroy docs: "Note that calling this function with the return from FcConfigGetCurrent will cause a new configuration to be created for use as current configuration." So this should be safe even if application execution continues after Qt shutdown, but it could trigger creation of a new current config in that case, if FontConfig calls are made. Fixes: QTBUG-92477 Pick-to: 5.15 6.1 6.2 Change-Id: I596055a84edc1a1b06157e2adf6c8627c6802db1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
2ca19d2dd3
commit
4f730fc5f1
@ -557,6 +557,11 @@ static void populateFromPattern(FcPattern *pattern, QFontDatabasePrivate::Applic
|
||||
|
||||
}
|
||||
|
||||
QFontconfigDatabase::~QFontconfigDatabase()
|
||||
{
|
||||
FcConfigDestroy(FcConfigGetCurrent());
|
||||
}
|
||||
|
||||
void QFontconfigDatabase::populateFontDatabase()
|
||||
{
|
||||
FcInit();
|
||||
|
@ -61,6 +61,7 @@ class QFontEngineFT;
|
||||
class Q_GUI_EXPORT QFontconfigDatabase : public QFreeTypeFontDatabase
|
||||
{
|
||||
public:
|
||||
~QFontconfigDatabase() override;
|
||||
void populateFontDatabase() override;
|
||||
void invalidate() override;
|
||||
QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override;
|
||||
|
Loading…
Reference in New Issue
Block a user