aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-01-26 15:40:29 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2015-01-29 09:32:59 +0000
commit9abd557e2c718b02fc0a14999150e50508ff5f9a (patch)
tree82da6dfdf1c183ea72eaae79322f41b1be72d364
parent0bba8d7411d0b1f1b547f9ac960e7d84769c7154 (diff)
QQuickTextItem: fix crash on polishing
The "d->extra" pointer is lazily allocated, hence we must check if it's valid before dereferencing it. Task-number: QTBUG-44128 Change-Id: Id69c91e889193b0e9b73ed178c0ff3b13003227f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/quick/items/qquicktext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index be86b2976b..51ae5ee93c 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -2737,7 +2737,7 @@ void QQuickText::invalidateFontCaches()
{
Q_D(QQuickText);
- if (d->richText && d->extra->doc != 0) {
+ if (d->richText && d->extra.isAllocated() && d->extra->doc != 0) {
QTextBlock block;
for (block = d->extra->doc->firstBlock(); block.isValid(); block = block.next()) {
if (block.layout() != 0 && block.layout()->engine() != 0)