Hi, all.
Well, I’m having some problem in removing a group of particle objects. I usually call the command display.remove(particleSystemObject) within the scene:destroy(event) function. Sometimes, when the button to play again is pressed before the particleSystemObject lifetime is over, the simulator crashes and close itself. When it does not crash the first time, the next time the game is over and the button is pressed, there comes the crash.
The same happens with a emitter object I have in the game. When needed, I also remove that one before the game is over.
I also tried using a
if(particleSystemObject)then display.remove(particleSystemObject); particleSystemObject = nil; end if(emitterObject)then display.remove(emitterObject); emitterObject = nil; end
within the scene:hide(event) function. This same snippet goes within the scene:destroy(event).
Can someone tell me what might be wrong?