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

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