From bd1713ef820a3d56fc19df46059fde3372092f9b Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 Jan 2021 09:08:50 +0100 Subject: 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 --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/hardwareintegration') diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index c0c86a6d..68f95d30 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) -- cgit v1.2.1