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>
This commit is contained in:
Tor Arne Vestbø 2018-09-05 14:38:28 +02:00
parent 367adc10de
commit 5ed48895b6

View File

@ -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();