From 57e3ef14fdcf6ae337075b68d374827b12397a7d Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 24 Jun 2014 12:21:46 +0200 Subject: Warn at runtime about badly threaded calls to QQuickItem::update() Change-Id: Ia3fc01f11ff28441d4ef095b520297a73e3399d6 Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index e4d61eb0ae..38318fdd00 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -979,9 +979,11 @@ void QSGThreadedRenderLoop::maybeUpdate(Window *w) if (!QCoreApplication::instance()) return; - Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread() || m_lockedForSync, - "QQuickItem::update()", - "Function can only be called from GUI thread or during QQuickItem::updatePaintNode()"); + QThread *current = QThread::currentThread(); + if (current != QCoreApplication::instance()->thread() && (current != w->thread || !m_lockedForSync)) { + qWarning() << "Updates can only be scheduled from GUI thread or from QQuickItem::updatePaintNode()"; + return; + } QSG_GUI_DEBUG(w->window, "maybeUpdate..."); if (!w || !w->thread->isRunning()) { -- cgit v1.2.3