path: root/src/quick/items/qquicktextedit_p.h
diff options
authorEskil Abrahamsen Blomfeldt <>2014-10-16 16:57:08 +0200
committerJani Heikkinen <>2014-11-13 19:58:28 +0100
commitdd08a22a4e8d7120341a1227e227de3f0628dd2f (patch)
tree6130ebf44600d5ec579752f617d9189875e7bb0b /src/quick/items/qquicktextedit_p.h
parentdd6e14a7df6e40ff8b9ffe22fe6124630a15bda0 (diff)
Invalidate font caches when switching between threadsv5.4.0-rc1
The font caches can only be used from a single thread at a time. QFontEngineFT for instance, uses a global static thread storage which is accessed on releasing and creating engines, and this causes a crash if the font engine is created on one thread and released on another. We use the updatePolish() function to make sure the caches are empty before entering updatePaintNode(), and then we invalidate the cache again after updatePaintNode() is done. [ChangeLog][Text] Fixed uncommon crash in text nodes. Change-Id: I01dbc2ed58aeebd03d77a157c700330334bdb385 Task-number: QTBUG-38800 Reviewed-by: Konstantin Ritt <>
Diffstat (limited to 'src/quick/items/qquicktextedit_p.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h
index 54e6dd229a..5d1c026c5c 100644
--- a/src/quick/items/qquicktextedit_p.h
+++ b/src/quick/items/qquicktextedit_p.h
@@ -330,6 +330,7 @@ private Q_SLOTS:
void markDirtyNodesForRange(int start, int end, int charDelta);
void updateTotalLines();
+ void invalidateFontCaches();
virtual void geometryChanged(const QRectF &newGeometry,
@@ -354,6 +355,7 @@ protected:
void inputMethodEvent(QInputMethodEvent *e);
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData);
+ void updatePolish();
friend class QQuickTextUtil;
friend class QQuickTextDocument;