aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2015-01-11 20:41:38 +0100
committerRobin Burchell <robin.burchell@viroteck.net>2015-01-16 19:00:26 +0100
commit9fe1588915b935298917a0c29593eeed70da682f (patch)
tree2aaecb12ddcaaec56fbc999de8f96acc90425f88 /src/particles
parent392329b44a50eb3baf1a0be181e831648f570098 (diff)
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 <gunnar@sletta.org>
Diffstat (limited to 'src/particles')
-rw-r--r--src/particles/qquickitemparticle.cpp2
1 files changed, 1 insertions, 1 deletions
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<QQuickItemParticleAttached*>(qmlAttachedPropertiesObject<QQuickItemParticle>(item))))
mpa->detach();//reparent as well?
- //TODO: Delete iff we created it
+ delete item;
m_activeCount--;
}
m_deletables.clear();