1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 00:32:49 +00:00

Close graphics context while it still exists

This commit is contained in:
AnyOldName3 2020-04-22 19:20:48 +01:00 committed by Bret Curtis
parent 0187d7ea37
commit d646a3fd0c

View File

@ -119,6 +119,13 @@ bool GLWidget::event( QEvent* event )
enqueueDeferredEvent(QEvent::ParentChange);
return true;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
else if (event->type() == QEvent::PlatformSurface && static_cast<QPlatformSurfaceEvent*>(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
{
if (_gw)
_gw->close();
}
#endif
// perform regular event handling
return QGLWidget::event( event );