From 9618fb7262b1b23ef5420ee83aa3b6b697eedc3e Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Fri, 19 Sep 2014 12:39:02 +0300 Subject: EGLFS: Fix plugin destruction The proper init/destruction order is as follows: QEglFsHooks::platformInit() eglInitialize() eglTerminate() QEglFsHooks::platformDestroy() Prior to this patch platformDestroy() was called before eglTerminate(), leading to a crash on some platforms. Additionally we need to destroy the native windows before deleting the screen, otherwise the QEglFSWindow destructor ends up calling into the deallocated screen. Change-Id: Id08ccbac9bb44a778bcf1a55f73c0057e0a7b3af Reviewed-by: Laszlo Agocs --- .../eglconvenience/qeglplatformintegration.cpp | 11 +++++++++++ .../eglconvenience/qeglplatformintegration_p.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/platformsupport') 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; } -- cgit v1.2.3