Daniel Russel wrote: > I can't find the imp-commit email for some reason. Anyway, there was a > recent patch (581) changing a > model::remove_particle to deactivating the particle. This change is > wrong as the particles are currently reference counted in C++ and > removing the particle from the model should do the right thing assuming > there are no python references hanging around. If it does not, it is a > bug in kernel code which should be fixed.
The testcase tried to use a Python reference to a particle which had already been deleted. This clearly won't work, which is why I fixed it in the patch. Running that testcase through valgrind clearly showed access to freed memory, as I wrote in the svn log. By all means, submit a patch which fixes the bug if you like. But the reference counting clearly does not work with Python right now, and I don't have time to fix this the "right" way.
> In fact, the "Particle::set_is_active" method should probably go away.
Sure - if we're going to allow particle deletion, there's no reason to have active/inactive.
Ben