Blame SOURCES/0012-Fix-memory-leak-in-QWaylandGLContext.patch

429548
From 9df11e79b46c77d8c83f765b2a8e85b639fd55a2 Mon Sep 17 00:00:00 2001
429548
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
429548
Date: Tue, 5 Jan 2021 09:08:50 +0100
429548
Subject: [PATCH 12/36] Fix memory leak in QWaylandGLContext
429548
429548
We were leaking an EGL context with every GL context created,
429548
which lead to rapid OOM errors in stress tests.
429548
429548
[ChangeLog][Qt Wayland Client] Fixed a memory leak when creating
429548
QOpenGLContexts on Wayland and using the wayland-egl backend.
429548
429548
Fixes: QTBUG-85608
429548
Pick-to: 5.15
429548
Pick-to: 6.0
429548
Change-Id: I8426b5df36ec7ab9e66ce15f9e02edad3aca60b9
429548
Reviewed-by: David Edmundson <davidedmundson@kde.org>
429548
---
429548
 .../client/wayland-egl/qwaylandglcontext.cpp                  | 4 +++-
429548
 1 file changed, 3 insertions(+), 1 deletion(-)
429548
429548
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
429548
index 681f82f4..befadedc 100644
429548
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
429548
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
429548
@@ -406,7 +406,9 @@ void QWaylandGLContext::updateGLFormat()
429548
 QWaylandGLContext::~QWaylandGLContext()
429548
 {
429548
     delete m_blitter;
429548
-    eglDestroyContext(m_eglDisplay, m_context);
429548
+    m_blitter = nullptr;
429548
+    if (m_decorationsContext != EGL_NO_CONTEXT)
429548
+        eglDestroyContext(eglDisplay(), m_decorationsContext);
429548
 }
429548
 
429548
 bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
429548
-- 
429548
2.33.1
429548