From 46556529ecaa85b2e37c2be9a83a003ff92cfd7a Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 16 Apr 2012 13:36:18 +0200 Subject: Fix a thread safety issue with QTextLine::glyphRuns This is a very partial revert of 10ac80708. Revert back to using engineFromScript, which is reentrant, for cases other than the "rawfont mode". In that last case, reentrancy is not a big issue so far as the only client is WebKit, and this is used in the web process, with no threaded rendering. Change-Id: I047b04cf0236d52e6d548f34cddd3dcc7c3c5f83 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gui/text/qtextlayout.cpp') diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index bec574bb83..94af3edeeb 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2288,7 +2288,13 @@ QList QTextLine::glyphRuns(int from, int length) const iterator.getSelectionBounds(&x, &width); if (glyphLayout.numGlyphs > 0) { - QFontEngine *mainFontEngine = eng->fontEngine(si); + QFontEngine *mainFontEngine; +#ifndef QT_NO_RAWFONT + if (eng->useRawFont && eng->rawFont.isValid()) + mainFontEngine= eng->fontEngine(si); + else +#endif + mainFontEngine = font.d->engineForScript(si.analysis.script); if (mainFontEngine->type() == QFontEngine::Multi) { QFontEngineMulti *multiFontEngine = static_cast(mainFontEngine); -- cgit v1.2.3