aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/adaptations/software
diff options
context:
space:
mode:
authorAndy Nichols <[email protected]>2023-03-14 14:33:47 +0100
committerAndy Nichols <[email protected]>2023-03-15 14:25:25 +0100
commitf1b188df132c42da62197055725e5f7eebcc4249 (patch)
tree3108abf2480c2acbc738326dc75313c9f79d6173 /src/quick/scenegraph/adaptations/software
parent354e727c40d3d10ad8851dc245ae1b3b64f41c99 (diff)
Software Adaptation: Don't leak QSGRenderContext resources
Subclasses of QSGRenderContext are responsible for releasing the resource tracked by the render context on invalidate. I'm not sure the software context will ever have any other resources than QSGTextures, but it doesn't hurt to try and release everything anyway. Fixes: QTBUG-106968 Pick-to: 6.5 6.4 6.2 Change-Id: I58902e1a33c0d3d101e39af3e5f0a18d6820ce98 Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
index 4da188bbfe..0c0ee5e579 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
@@ -107,6 +107,18 @@ void QSGSoftwareRenderContext::initializeIfNeeded()
void QSGSoftwareRenderContext::invalidate()
{
+ qDeleteAll(m_texturesToDelete);
+ m_texturesToDelete.clear();
+
+ qDeleteAll(m_textures);
+ m_textures.clear();
+
+ qDeleteAll(m_fontEnginesToClean);
+ m_fontEnginesToClean.clear();
+
+ qDeleteAll(m_glyphCaches);
+ m_glyphCaches.clear();
+
m_sg->renderContextInvalidated(this);
emit invalidated();
}