From 2dae3775d93b8ac31ffdd09050a715734313c9ba Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 7 Feb 2024 15:04:53 +1100 Subject: [PATCH] qml6: fix a leak of the wrapped QSGTextures Part-of: --- .../gst-plugins-good/ext/qt6/gstqsg6material.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-good/ext/qt6/gstqsg6material.cc b/subprojects/gst-plugins-good/ext/qt6/gstqsg6material.cc index bf50841097..8261e4e215 100644 --- a/subprojects/gst-plugins-good/ext/qt6/gstqsg6material.cc +++ b/subprojects/gst-plugins-good/ext/qt6/gstqsg6material.cc @@ -222,6 +222,10 @@ GstQSGTexture::GstQSGTexture(QRhiTexture * texture) GstQSGTexture::~GstQSGTexture() { + if (m_texture) { + delete m_texture; + m_texture = nullptr; + } } qint64 @@ -291,6 +295,12 @@ GstQSGMaterialShader::GstQSGMaterialShader(GstVideoFormat v_format) GstQSGMaterialShader::~GstQSGMaterialShader() { + for (int i = 0; i < 4; i++) { + if (m_textures[i]) { + delete m_textures[i]; + m_textures[i] = nullptr; + } + } } bool