From c0772f44fb1d53608ff629fc622103698c6d0ee5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 13 Jul 2011 15:06:43 +0200 Subject: 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 --- src/gui/text/qtextengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 648f5c0..6c13eae 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2789,6 +2789,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) { -- cgit v0.12