aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgthreadedrenderloop.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2015-04-15 13:57:51 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2015-04-23 15:00:46 +0000
commit92433623b31388e2e8c4d532033dad6189eaab24 (patch)
tree1a20685ae0f7e5d3137ca001c2c222ae16aaf241 /src/quick/scenegraph/qsgthreadedrenderloop.cpp
parent3fdec636980c23b14cfc6aa74bc48bbb960ba0b4 (diff)
Fix a memory leak in the material shader cache.
There were multiple problems in the implementation of the shader cache: 1) it was not thread-safe 2) nothing was ever removed from the hash 3) since the keys into the hash are the actual shader source code, problem #2 would lead to serious memory consumption over time Change-Id: I20d1fb2074932e23f89edddba12e68ab8adcbff0 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 7b1e24246b..26a0e78254 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -56,6 +56,8 @@
#include <private/qquickprofiler_p.h>
#include <private/qqmldebugservice_p.h>
+#include <private/qquickshadereffectnode_p.h>
+
/*
Overall design:
@@ -449,6 +451,8 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor,
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- cleanup without an OpenGL context";
}
+ QQuickShaderEffectMaterial::cleanupMaterialCache();
+
// The canvas nodes must be cleaned up regardless if we are in the destructor..
if (wipeSG) {
QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window);