diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index b8205dc575..a6207cf402 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -95,9 +95,15 @@ QEGLPlatformIntegration::QEGLPlatformIntegration() QEGLPlatformIntegration::~QEGLPlatformIntegration() { + foreach (QWindow *w, qGuiApp->topLevelWindows()) + w->destroy(); + delete m_screen; + if (m_display != EGL_NO_DISPLAY) eglTerminate(m_display); + + destroy(); } void QEGLPlatformIntegration::initialize() @@ -118,6 +124,11 @@ void QEGLPlatformIntegration::initialize() m_vtHandler.reset(new QFbVtHandler); } +void QEGLPlatformIntegration::destroy() +{ + +} + QAbstractEventDispatcher *QEGLPlatformIntegration::createEventDispatcher() const { return createUnixEventDispatcher(); diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h index 4d7adce309..11977db78b 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h @@ -65,6 +65,7 @@ public: ~QEGLPlatformIntegration(); void initialize() Q_DECL_OVERRIDE; + virtual void destroy(); QEGLPlatformScreen *screen() const { return m_screen; } EGLDisplay display() const { return m_display; } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 12b8fabdfc..16d8c50291 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -67,11 +67,6 @@ QEglFSIntegration::QEglFSIntegration() initResources(); } -QEglFSIntegration::~QEglFSIntegration() -{ - QEglFSHooks::hooks()->platformDestroy(); -} - bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const { // We assume that devices will have more and not less capabilities @@ -91,6 +86,11 @@ void QEglFSIntegration::initialize() createInputHandlers(); } +void QEglFSIntegration::destroy() +{ + QEglFSHooks::hooks()->platformDestroy(); +} + EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const { return QEglFSHooks::hooks()->platformDisplay(); diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index d612a270f2..59aabebb7a 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -44,9 +44,9 @@ class QEglFSIntegration : public QEGLPlatformIntegration { public: QEglFSIntegration(); - ~QEglFSIntegration(); void initialize() Q_DECL_OVERRIDE; + void destroy() Q_DECL_OVERRIDE; bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; QVariant styleHint(QPlatformIntegration::StyleHint hint) const Q_DECL_OVERRIDE;