aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgthreadedrenderloop.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-06-24 12:21:46 +0200
committerGunnar Sletta <gunnar.sletta@jollamobile.com>2014-06-25 09:54:42 +0200
commit57e3ef14fdcf6ae337075b68d374827b12397a7d (patch)
treeb3256217176b97dd879c09ada15bead62e586146 /src/quick/scenegraph/qsgthreadedrenderloop.cpp
parent9f22767784dc859283b321c47636ea708eef3bfe (diff)
Warn at runtime about badly threaded calls to QQuickItem::update()
Change-Id: Ia3fc01f11ff28441d4ef095b520297a73e3399d6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp8
1 files 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()) {