From 22e6942d5a673f873c3f018bd16ca42a1fafd58e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 4 Apr 2017 11:31:36 +0200 Subject: Ensure Shader disconnects the destroyed listener from the context cleanup() is never called. The signal must be disconnected nonetheless, otherwise bad things can happen. For example, with a Scene3D in a QQuickWidget the context will be destroyed at a different stage than with QQuickWindow, and Shader may already be destroyed at that stage. Task-number: QTBUG-52132 Change-Id: Icbc8fe0294e0fa6a33385f7d9a2f81ef9f514283 Reviewed-by: Sean Harmer Reviewed-by: Paul Lemire --- src/render/materialsystem/shader.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/render/materialsystem/shader.cpp b/src/render/materialsystem/shader.cpp index e534a1ffc..3ee00739d 100644 --- a/src/render/materialsystem/shader.cpp +++ b/src/render/materialsystem/shader.cpp @@ -72,6 +72,8 @@ Shader::~Shader() { // TO DO: ShaderProgram is leaked as of now // Fix that taking care that they may be shared given a same dna + if (m_graphicsContext) + QObject::disconnect(m_contextConnection); } void Shader::cleanup() -- cgit v1.2.3