summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-07-13 15:06:43 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-13 15:13:52 +0200
commit1f8418807a44761716aaff53b92164a4d2523a9d (patch)
tree4fd90132ecf294634682b4a6e8e7366a0cc98567
parentebfd24a20b1acdced5fe032eedb2737efdc6eb92 (diff)
Fix potential crash when clicking in a text edit
Since the attributes() call might resize the layout and therefore delete the previous data, the logClusters pointer might be dangling at this point. We need to reget it to make sure it's valid. Task-number: QTBUG-20310 Reviewed-by: Jiang Jiang (cherry picked from commit c0772f44fb1d53608ff629fc622103698c6d0ee5) Change-Id: I20a29d0c529764eb5d41cb3383c22b6cad8de255 Reviewed-on: http://codereview.qt.nokia.com/1598 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
-rw-r--r--src/gui/text/qtextengine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index e8e6c98eab..5cb0bfea80 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2872,6 +2872,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
}
const HB_CharAttributes *attrs = attributes();
+ logClusters = this->logClusters(si);
clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart);
if (clusterLength) {