Posted: 16th Dec 2011 0:41
When I create a particle emitter thus:

ParticleSet=CreateParticles()

I get an id starting at 10000.

When I dynamically delete this emitter and create another, I get an ID of 10001, then 10002 and so on.

Is this expected? I am not 100% sure the previous emitter was totally deleted if the ID keeps incrementing like this, even though I have removed the old one.

I was only going to allow 10 emitters of this type per level, but my cleanup loop would really like to have an end number to check with GetParticlesExists() for efficiency.
Posted: 16th Dec 2011 1:13
That is normal. Rather than check previously assign IDs to see if they have been deleted it just moves on to the next likely free ID. The data structure used to store them can cope with IDs up to 2,147,483,647 so there are plenty of free ones.
Posted: 16th Dec 2011 2:11
Well, as long as the structure has gone, that's something.
Cleaning up is not as manageable as one would hope.

I think there's scope for some easy cleanup options (as a change request) because it's quite a chore to keep tabs on everything.

I think someone maybe requested a "media clear down" type option for the future - but I was thinking more along the lines of better resource management functions full stop.

At the moment then, the only way is to keep track of them yourself.

[edit] I guess this applies to all other items which are auto-allocated this way?