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(); }