summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
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-06 13:02:17 +0100
commitbd1713ef820a3d56fc19df46059fde3372092f9b (patch)
tree950566b51d88445fd6afe7566e6763a5aa1429e1 /src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
parent3b01a7386f586f0cd7edcbca635a6397db81c8ec (diff)
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 Pick-to: 5.15 Pick-to: 6.0 Change-Id: I8426b5df36ec7ab9e66ce15f9e02edad3aca60b9 Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp')
-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 c0c86a6dd..68f95d30f 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -297,6 +297,8 @@ QWaylandGLContext::~QWaylandGLContext()
{
delete m_blitter;
m_blitter = nullptr;
+ if (m_decorationsContext != EGL_NO_CONTEXT)
+ eglDestroyContext(eglDisplay(), m_decorationsContext);
}
bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)