From 5ed48895b6974814fb7ac7ec42a6fc8ee935be44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 5 Sep 2018 14:38:28 +0200 Subject: tst_qglthreads::swapInThread(): Acquire context before resizing widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/opengl') 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(); -- cgit v1.2.3