summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@digia.com>2014-09-19 12:39:02 +0300
committerLouai Al-Khanji <louai.al-khanji@digia.com>2014-10-01 10:59:51 +0200
commit9618fb7262b1b23ef5420ee83aa3b6b697eedc3e (patch)
tree5202084588ab2eefc876f80ada170d8d6ebab4b3 /src/platformsupport
parentbd09405792ba3b3552a9e31e515a406c38b8ddc1 (diff)
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 <laszlo.agocs@digia.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration.cpp11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration_p.h1
2 files changed, 12 insertions, 0 deletions
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; }