summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-09-05 14:38:28 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-09-06 12:42:06 +0000
commit5ed48895b6974814fb7ac7ec42a6fc8ee935be44 (patch)
tree9916e0ce8b87ff1c95e7195d7501c45407f57f10 /tests
parent367adc10de1d6c1f02546a543ddfd50471a1b03d (diff)
tst_qglthreads::swapInThread(): Acquire context before resizing widget
Otherwise the QGLWidget's context may be owned by and used by the swap thread when the resize happens on the main thread. Change-Id: Id415747572e6b988924618b1df0efdee5fcb1805 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 76186f5575..09bea20d26 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -131,6 +131,13 @@ public:
setAutoBufferSwap(false);
}
+ void resizeEvent(QResizeEvent *e)
+ {
+ m_thread->lock();
+ QGLWidget::resizeEvent(e);
+ m_thread->unlock();
+ }
+
void paintEvent(QPaintEvent *)
{
m_thread->lock();