diff --git a/platform.cpp b/platform.cpp index 9064463fa2..f5ca28b94c 100644 --- a/platform.cpp +++ b/platform.cpp @@ -42,9 +42,6 @@ Platform::Platform(QObject *parent) Platform::~Platform() { - if (m_eglDisplay != EGL_NO_DISPLAY) { - eglTerminate(m_eglDisplay); - } } PlatformCursorImage Platform::cursorImage() const diff --git a/plugins/platforms/drm/drm_gpu.cpp b/plugins/platforms/drm/drm_gpu.cpp index 25a2063551..e1264f89fb 100644 --- a/plugins/platforms/drm/drm_gpu.cpp +++ b/plugins/platforms/drm/drm_gpu.cpp @@ -57,6 +57,9 @@ DrmGpu::DrmGpu(DrmBackend *backend, QByteArray devNode, int fd, int drmId) : m_b DrmGpu::~DrmGpu() { + if (m_eglDisplay != EGL_NO_DISPLAY) { + eglTerminate(m_eglDisplay); + } #if HAVE_GBM gbm_device_destroy(m_gbmDevice); #endif diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp index 196ea3718b..44344b1ed9 100644 --- a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp +++ b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp @@ -147,6 +147,9 @@ HwcomposerBackend::~HwcomposerBackend() if (!m_outputBlank) { toggleBlankOutput(); } + if (sceneEglDisplay() != EGL_NO_DISPLAY) { + eglTerminate(sceneEglDisplay()); + } } void HwcomposerBackend::init() diff --git a/plugins/platforms/virtual/virtual_backend.cpp b/plugins/platforms/virtual/virtual_backend.cpp index 45696eec3b..3f0431df0a 100644 --- a/plugins/platforms/virtual/virtual_backend.cpp +++ b/plugins/platforms/virtual/virtual_backend.cpp @@ -42,6 +42,9 @@ VirtualBackend::VirtualBackend(QObject *parent) VirtualBackend::~VirtualBackend() { + if (sceneEglDisplay() != EGL_NO_DISPLAY) { + eglTerminate(sceneEglDisplay()); + } } void VirtualBackend::init() diff --git a/plugins/platforms/wayland/wayland_backend.cpp b/plugins/platforms/wayland/wayland_backend.cpp index 15ed841015..3561616b55 100644 --- a/plugins/platforms/wayland/wayland_backend.cpp +++ b/plugins/platforms/wayland/wayland_backend.cpp @@ -462,6 +462,10 @@ WaylandBackend::WaylandBackend(QObject *parent) WaylandBackend::~WaylandBackend() { + if (sceneEglDisplay() != EGL_NO_DISPLAY) { + eglTerminate(sceneEglDisplay()); + } + if (m_pointerConstraints) { m_pointerConstraints->release(); } diff --git a/plugins/platforms/x11/standalone/x11_platform.cpp b/plugins/platforms/x11/standalone/x11_platform.cpp index b7980b963b..fa47643e4f 100644 --- a/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/plugins/platforms/x11/standalone/x11_platform.cpp @@ -73,6 +73,9 @@ X11StandalonePlatform::~X11StandalonePlatform() m_openGLFreezeProtectionThread->wait(); delete m_openGLFreezeProtectionThread; } + if (sceneEglDisplay() != EGL_NO_DISPLAY) { + eglTerminate(sceneEglDisplay()); + } if (isReady()) { XRenderUtils::cleanup(); } diff --git a/plugins/platforms/x11/windowed/x11windowed_backend.cpp b/plugins/platforms/x11/windowed/x11windowed_backend.cpp index 9b24c03d26..50c9f899b6 100644 --- a/plugins/platforms/x11/windowed/x11windowed_backend.cpp +++ b/plugins/platforms/x11/windowed/x11windowed_backend.cpp @@ -49,6 +49,9 @@ X11WindowedBackend::X11WindowedBackend(QObject *parent) X11WindowedBackend::~X11WindowedBackend() { + if (sceneEglDisplay() != EGL_NO_DISPLAY) { + eglTerminate(sceneEglDisplay()); + } if (m_connection) { if (m_keySymbols) { xcb_key_symbols_free(m_keySymbols);