summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-08-19 14:44:21 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-08-30 11:43:35 +0000
commitce2815b43c3f10c474c35d30197e14c58c9106ff (patch)
tree474915e67a57984f1cfe6e5c13f1a2265a085fc9 /src/gui/kernel/qwindow.cpp
parent17e5d9d7cadb4fceb39cfc875162add57e962db8 (diff)
Guard against calling QWindow::requestUpdate() on non-GUI threads
Change-Id: I851ff672bc234146deb61615fc7c56df87d62065 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 2e212e5fdb..bcd29b6fe1 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2160,6 +2160,9 @@ void QWindowPrivate::deliverUpdateRequest()
*/
void QWindow::requestUpdate()
{
+ Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(),
+ "QWindow", "Updates can only be scheduled from the GUI (main) thread");
+
Q_D(QWindow);
if (d->updateRequestPending || !d->platformWindow)
return;