Cleanup problem with director -- help please!

I’m using director, level helper, and particle candy.
Everything was working until I added particle candy. Now it crashes when I change scenes. I have traced it back to the following command in the deleteEmitter function.

V.Emitters[name]:removeSelf()

It appears that the code hangs on this command and since the emitter isn’t erased it crashes director.

I have the following in my cleanup function:
Particles.ClearParticles()
Particles.CleanUp()
FXLibrary.CleanUp()

I haven’t stored any emitter handles.

Anyone have ANY ideas? I’ve been troubleshooting this one all day.

Thanks!
[import]uid: 16901 topic_id: 21075 reply_id: 321075[/import]

I tried assigning a handle to the emitter and brute forcing the removeSelf() command but it hangs on that also. It really seems like I’m forgetting to do something important before I try to remove the emitter. Hmmm… [import]uid: 16901 topic_id: 21075 reply_id: 83253[/import]

Is it possible the emitter is already gone when you try to call removeSelf() ?

Just for kicks try using

display.remove(V.Emitters[name])  

This will achieve the same thing, but it won’t raise an error if the object is trying to be removed is already gone.
All I can think of for a suggestion, good luck

–Croisened
[import]uid: 48203 topic_id: 21075 reply_id: 83325[/import]

Thanks for the suggestion… It’s weird. It does appear that the code thinks the emitter is removed already during cleanup but it then complains that the emitter still exists when then level relaunches.

When I print (V.Emitters[name].removeSelf) it shows nill.

When the level is reloaded it then complains that the Emitter is already present.

Hmmmm… [import]uid: 16901 topic_id: 21075 reply_id: 83336[/import]

Well I reimplemented from scratch and now the only problem I have is if the sound is effects sound (e.g., rain, explosion) is running when I switch screens I get the following error:
ALmixer_FreeData: alDeleteBuffers failed. Invalid Operation

Disable the sound and all is good. I’m off to look into the ALmixer thing.

SOLVED:
Turns out I just had to stop all audio via audio.stop()
Not sure why particle candy doesn’t do this… but it works some I’m very happy!

[import]uid: 16901 topic_id: 21075 reply_id: 83375[/import]

Again, not a viable solution for all. audio.stop() stops all audio, including background music. Spawning and killing actors is becoming a credible choir all due to audio release… [import]uid: 21331 topic_id: 21075 reply_id: 99367[/import]