Windows: Release old references when invalidating DirectWrite db
When the font database is invalidated, we need to release all references to populated fonts and clear the lists, so that they can be repopulated from scratch. This was not really measurable as long as the contents of the database did not change, but it was a possible source of errors. Task-number: QTBUG-129849 Change-Id: Ic7ed4abcb13f13332e8edb77e2039f08da9660fd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2ea099b67943634a06bce642e13062f84de7e3be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6dfe5c847e
commit
7bf79ee390
@ -801,4 +801,17 @@ bool QWindowsDirectWriteFontDatabase::supportsVariableApplicationFonts() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void QWindowsDirectWriteFontDatabase::invalidate()
|
||||
{
|
||||
QWindowsFontDatabase::invalidate();
|
||||
|
||||
for (IDWriteFontFamily *value : m_populatedFonts)
|
||||
value->Release();
|
||||
m_populatedFonts.clear();
|
||||
m_populatedFonts.squeeze();
|
||||
|
||||
m_populatedBitmapFonts.clear();
|
||||
m_populatedBitmapFonts.squeeze();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -59,6 +59,9 @@ public:
|
||||
return m_populatedFonts.contains(fontFamily);
|
||||
}
|
||||
|
||||
protected:
|
||||
void invalidate() override;
|
||||
|
||||
private:
|
||||
friend class QWindowsFontEngineDirectWrite;
|
||||
static QString localeString(IDWriteLocalizedStrings *names, wchar_t localeName[]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user