summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem/shader.cpp
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2017-01-29 10:32:42 +0000
committerSean Harmer <sean.harmer@kdab.com>2017-01-30 10:54:27 +0000
commit19847a8c247709a7b9825f494ede56aad7ed231f (patch)
tree0bcf9ba1eab021cd4ffb8de2f4980c159c0382b7 /src/render/materialsystem/shader.cpp
parent126a93f0cc06cc4339b2bf04798e09ecfd15bd82 (diff)
Shutdown fixes
Wait for render thread to finish when shutting down. Was causing crashes in some background nodes still being accessed after the node manager was destroyed. Shader disconnects from glcontext destroy messages when that context is reset. Thread affinity of glcontext and shader meant the destroyed signal from the glcontext could be delivered to a shader that had already been destroyed. Change-Id: I283701e8d008343b3fccf6769d71695b1c6a1ea4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/materialsystem/shader.cpp')
-rw-r--r--src/render/materialsystem/shader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/render/materialsystem/shader.cpp b/src/render/materialsystem/shader.cpp
index ae547836a..02f58dfbc 100644
--- a/src/render/materialsystem/shader.cpp
+++ b/src/render/materialsystem/shader.cpp
@@ -72,8 +72,6 @@ Shader::~Shader()
{
// TO DO: ShaderProgram is leaked as of now
// Fix that taking care that they may be shared given a same dna
-
- QObject::disconnect(m_contextConnection);
}
void Shader::cleanup()
@@ -85,6 +83,7 @@ void Shader::cleanup()
if (m_graphicsContext)
m_graphicsContext->removeShaderProgramReference(this);
m_graphicsContext = nullptr;
+ QObject::disconnect(m_contextConnection);
}
QBackendNode::setEnabled(false);