Avoid repaints and swapbuffers when the platform window is already gone
On Linux at least the qopenglwindow example sometimes shows "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined" when closing the window and exiting the application. This patch avoids this by not triggering repaints anymore when the platform window is destroyed. Change-Id: I54bd41e5c1471f7cdfec89f8ec3be48d1438be39 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>bb10
parent
4ff12977d8
commit
37023a096d
|
|
@ -188,7 +188,8 @@ bool QPaintDeviceWindow::event(QEvent *event)
|
|||
|
||||
if (event->type() == QEvent::UpdateRequest) {
|
||||
d->paintEventSent = false;
|
||||
d->handleUpdateEvent();
|
||||
if (handle()) // platform window may be gone when the window is closed during app exit
|
||||
d->handleUpdateEvent();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue