summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont_win.cpp
diff options
context:
space:
mode:
authorSimon Yuan <simon.yuan@navico.com>2014-04-02 16:02:04 +1300
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 21:20:09 +0200
commit45693cc638d10890f2816a38d38de6ddaf04ffd3 (patch)
tree4f1366fe1cf1ad82b594ce6f05467c0a79d1a978 /src/gui/text/qrawfont_win.cpp
parent5267ff3c462986f514f33998a2614b8f9c22402e (diff)
Memory and file descriptor leak in QFontCache
Make the cache also use the ref counts Make everyone who decrements a ref count check for 0 and delete Move all cache logic to the cache Same idea as 36cb3f3 and b3dae68 in Qt 5 without the extra stuff Task-number: QTBUG-38035 Change-Id: I27bea376f4ec0888463b4ec3ed1a6bef00d041f8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/gui/text/qrawfont_win.cpp')
-rw-r--r--src/gui/text/qrawfont_win.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qrawfont_win.cpp b/src/gui/text/qrawfont_win.cpp
index 6923aaeb82..9b66886774 100644
--- a/src/gui/text/qrawfont_win.cpp
+++ b/src/gui/text/qrawfont_win.cpp
@@ -600,11 +600,11 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData,
if (request.family != fontEngine->fontDef.family) {
qWarning("QRawFont::platformLoadFromData: Failed to load font. "
"Got fallback instead: %s", qPrintable(fontEngine->fontDef.family));
- if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
+ if (fontEngine->ref == 0)
delete fontEngine;
fontEngine = 0;
} else {
- Q_ASSERT(fontEngine->cache_count == 0 && fontEngine->ref == 0);
+ Q_ASSERT(fontEngine->ref == 0);
// Override the generated font name
static_cast<QFontEngineWin *>(fontEngine)->uniqueFamilyName = uniqueFamilyName;