summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-01-05 09:08:50 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-01-26 10:09:08 +0100
commitadc364c96fbd884ef706a68ba9188a94544d13d3 (patch)
tree73093181ae1bdbfb10b2d27b239cd56b13375acc
parenta8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 (diff)
downloadqtwayland-adc364c96fbd884ef706a68ba9188a94544d13d3.tar.gz
Fix memory leak in QWaylandGLContext
We were leaking an EGL context with every GL context created, which lead to rapid OOM errors in stress tests. [ChangeLog][Qt Wayland Client] Fixed a memory leak when creating QOpenGLContexts on Wayland and using the wayland-egl backend. Fixes: QTBUG-85608 Change-Id: I8426b5df36ec7ab9e66ce15f9e02edad3aca60b9 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit bd1713ef820a3d56fc19df46059fde3372092f9b) Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 681f82f4..1a1c349d 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -406,6 +406,8 @@ void QWaylandGLContext::updateGLFormat()
QWaylandGLContext::~QWaylandGLContext()
{
delete m_blitter;
+ if (m_decorationsContext != EGL_NO_CONTEXT)
+ eglDestroyContext(m_eglDisplay, m_decorationsContext);
eglDestroyContext(m_eglDisplay, m_context);
}