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!

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....

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

Just for kicks try using

1
display.remove(V.Emitters[name])

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....

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!

views:2026 update:2012/2/10 9:26:24
corona forums © 2003-2011