QWindowsFontEngineDirectWrite: Fix resources leaking

fontFamily has been acquired by IDWriteFont::GetFontFamily() and thus
must be released with IDWriteFontFamily::Release().

Task-number: QTBUG-26861

Change-Id: I314153f97b8b59c9ba728220f93b493b13337039
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Konstantin Ritt 2013-04-12 15:27:32 +03:00 committed by The Qt Project
parent d121b37a4a
commit 112b31bed6

View File

@ -740,6 +740,8 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
if (familyNames != NULL)
familyNames->Release();
if (fontFamily)
fontFamily->Release();
if (FAILED(hr))
qErrnoWarning(hr, "initFontInfo: Failed to get family name");