From 11370f0a43bc2912b529573689941fe88446ff0f Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 27 Jun 2015 19:51:30 +0200 Subject: [PATCH] eglfs: Destroy screens after windows Screens must be destroyed after windows otherwise the application will crash on QEglFSWindow::destroy() because the screen is NULL. Change-Id: I315ddc267dd0d2dd2a1c4f3a0c319c8f2c11ec28 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index d1688df8f5..5eb8485dc7 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -106,8 +106,11 @@ void QEglFSIntegration::initialize() void QEglFSIntegration::destroy() { + foreach (QWindow *w, qGuiApp->topLevelWindows()) + w->destroy(); qt_egl_device_integration()->screenDestroy(); - QEGLPlatformIntegration::destroy(); + if (display() != EGL_NO_DISPLAY) + eglTerminate(display()); qt_egl_device_integration()->platformDestroy(); }