From 6fabc0683c6cf0736b4ae9a00f1b138803e461d1 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 8 Jul 2016 13:06:21 +0200 Subject: QtQuick: fix use-after-free of shader property connections A use-after-free would occur if the sender of a connection would disconnect (and destroy the slot object), and then the receiver would try to clean-up and access the slot object again. The fix is to have the receiver take out a reference to the slot object, because it will manage the life-time, and thus delete the slot object when it doesn't need it anymore. Change-Id: Ie2033cfb7212acceb2c2cd0bd9e7e45c2dd5e434 Reviewed-by: Robin Burchell --- src/particles/qquickcustomparticle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/particles') diff --git a/src/particles/qquickcustomparticle.cpp b/src/particles/qquickcustomparticle.cpp index 8ee431aeb2..c08ae3d9ff 100644 --- a/src/particles/qquickcustomparticle.cpp +++ b/src/particles/qquickcustomparticle.cpp @@ -207,7 +207,7 @@ void QQuickCustomParticle::updateVertexShader() { m_common.disconnectPropertySignals(this, Key::VertexShader); m_common.uniformData[Key::VertexShader].clear(); - m_common.signalMappers[Key::VertexShader].clear(); + m_common.clearSignalMappers(Key::VertexShader); m_common.attributes.clear(); m_common.attributes.append("qt_ParticlePos"); m_common.attributes.append("qt_ParticleTex"); -- cgit v1.2.3