diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-12-12 11:54:54 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-12-17 08:10:19 +0000 |
commit | 3ccdeb4b58b681bb3a0a43f926f81fd94f527680 (patch) | |
tree | 44454b850775d66f8b64fdbfe4e54fb9c1049b38 /src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | |
parent | 87b20009cc63d3a51e2eb93cd8492c77157b283b (diff) |
Remove specialized multi font engine on Windows
This was added as a platform-specific implementation of the multi engine
in 2005, before this code was generalized, and it currently only has the purpose
of special handling loadEngine().
The way this was special handled was by creating a new QFontEngine for every
fallback family *every* time, never checking if the font engine already exists
in the cache (like the superclass implementation does). The result of this was
that if you had 500 fonts and each of them had 500 fallback fonts, and made
a loop that would load all of them, then you would get 250000 font engines.
At some point before this, we would run out of available handles and crash.
There shouldn't be any need to have special handling of fallback font loading
on Windows (i.e. all the platform specific parts should go through the normal
mechanisms in QPA), so lets just go through the superclass implementation instead.
[ChangeLog][Windows][Text] Reduced the number of font engines that are
created when loading new fonts, fixing crashes in some special cases where
a large number of fonts are created during a short period of time.
Fixes: QTBUG-70032
Change-Id: I05040dd458e820510685e8c6df8f31876d9bdb89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 9ff50bdf05..40ac46df85 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1264,11 +1264,6 @@ QWindowsFontDatabase::~QWindowsFontDatabase() removeApplicationFonts(); } -QFontEngineMulti *QWindowsFontDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) -{ - return new QWindowsMultiFontEngine(fontEngine, script); -} - QFontEngine * QWindowsFontDatabase::fontEngine(const QFontDef &fontDef, void *handle) { const QString faceName(static_cast<const QChar*>(handle)); |