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:
parent
367adc10de
commit
5ed48895b6
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user