summaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-10-16 16:57:08 +0200
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>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 <ritt.ks@gmail.com>
Diffstat (limited to 'src/quick/items/qquicktextedit_p.h')
-rw-r--r--src/quick/items/qquicktextedit_p.h2
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:
private:
void markDirtyNodesForRange(int start, int end, int charDelta);
void updateTotalLines();
+ void invalidateFontCaches();
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -354,6 +355,7 @@ protected:
void inputMethodEvent(QInputMethodEvent *e);
#endif
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData);
+ void updatePolish();
friend class QQuickTextUtil;
friend class QQuickTextDocument;