From 96348d4146a3faac194f18ceb251f3b0252f6a77 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 16 Aug 2011 11:22:55 +0200 Subject: [PATCH] Fix crash-on-exit in qmlscene Add 0-pointer check to the renderThread access in maybeUpdate(), which is in some cases called from ~QSGCanvas() after the thread has been deleted. (the call happens as a part of SGRootItem destruction.) Change-Id: Icbcc0d7ad9af54d24ca99f254646b636c2eb9ebb Reviewed-on: http://codereview.qt.nokia.com/2995 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/declarative/items/qsgcanvas.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 19e9f99..ec3a2ca 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -1752,7 +1752,7 @@ void QSGCanvas::maybeUpdate() { Q_D(QSGCanvas); - if (d->thread->isRunning()) { + if (d->thread && d->thread->isRunning()) { Q_ASSERT_X(QThread::currentThread() == QApplication::instance()->thread() || d->thread->inSync, "QSGCanvas::update", "Function can only be called from GUI thread or during QSGItem::updatePaintNode()"); -- 1.7.2.5