Windows: Fix memory leak in DirectWrite font database
In ec38f0002de74f343e808c2f5d6363003f5264e8, we introduced a guard for automatically releasing references to DirectWrite types to plug a small leak. Unfortunately, this change removed a call to Release() without putting the pointer inside a guard, hence it introduced another leak. This was noticeable if the font database was invalidated and repopulated multiple times. [ChangeLog][Windows] Fixed a memory leak when repopulating the DirectWrite font database. Task-number: QTBUG-129849 Change-Id: I59e3132b6836501b7756679ffac82fb65e3027cb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 247cd80abdd5fc0bc6243581e506354a5509518e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5c675fb298
commit
6dfe5c847e
@ -136,7 +136,7 @@ void QWindowsDirectWriteFontDatabase::populateFamily(const QString &familyName)
|
||||
DWRITE_FONT_STYLE_NORMAL,
|
||||
&matchingFonts))) {
|
||||
for (uint j = 0; j < matchingFonts->GetFontCount(); ++j) {
|
||||
IDWriteFont *font;
|
||||
DirectWriteScope<IDWriteFont> font;
|
||||
if (SUCCEEDED(matchingFonts->GetFont(j, &font))) {
|
||||
DirectWriteScope<IDWriteFont1> font1;
|
||||
if (!SUCCEEDED(font->QueryInterface(__uuidof(IDWriteFont1),
|
||||
|
Loading…
x
Reference in New Issue
Block a user