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
Laszlo Agocs 2014-08-06 10:23:43 +02:00
parent 4ff12977d8
commit 37023a096d
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}