From 37023a096d5fec6937bca25047973a05041db66f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 6 Aug 2014 10:23:43 +0200 Subject: 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 --- src/gui/kernel/qpaintdevicewindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qpaintdevicewindow.cpp') diff --git a/src/gui/kernel/qpaintdevicewindow.cpp b/src/gui/kernel/qpaintdevicewindow.cpp index 232e8b5d6d..9c6a255ca7 100644 --- a/src/gui/kernel/qpaintdevicewindow.cpp +++ b/src/gui/kernel/qpaintdevicewindow.cpp @@ -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; } -- cgit v1.2.3