From 9fe1588915b935298917a0c29593eeed70da682f Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 11 Jan 2015 20:41:38 +0100 Subject: QQuickItemParticle: delete delegates once they are completed. This was one gigantic memory leak, if anyone tried to use this functionality, as evidenced by the bug. The comment notes that deletion was only to be done if the items were created by the ItemParticle, but I don't think this makes sense: take()'s documentation doesn't imply that the ownership of the item stays with the creator, and nor does this seem to be a particularly sensible API decision to make, so I'm not going to implement that. Change-Id: I307d77b70c2b4f7b34565865f8efcfe64817be2f Task-number: QTBUG-37486 Reviewed-by: Gunnar Sletta --- src/particles/qquickitemparticle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/particles') diff --git a/src/particles/qquickitemparticle.cpp b/src/particles/qquickitemparticle.cpp index 3c6e249a4a..4f81c0662b 100644 --- a/src/particles/qquickitemparticle.cpp +++ b/src/particles/qquickitemparticle.cpp @@ -149,7 +149,7 @@ void QQuickItemParticle::tick(int time) QQuickItemParticleAttached* mpa; if ((mpa = qobject_cast(qmlAttachedPropertiesObject(item)))) mpa->detach();//reparent as well? - //TODO: Delete iff we created it + delete item; m_activeCount--; } m_deletables.clear(); -- cgit v1.2.3