Stepper causes segfault at deletion.

ceacy

29-11-2006 23:04:38

Hi,
I'm using a steeper set to Automatic in my application : as long as it is used, there's no problem.
But when i change my app state (from "PlayState" to "MenuState"), i have to delete it.
So, Stepper::~Stepper calls "setAutomatic(AutoMode_NotAutomatic);" to unregister itself as FrameListener. This should be ok. However, i get this kind of problem : the frame listener will only be deleted at next iteration ... but my program doesn't wait until it's removed : Ogre calls the deleted frame listener, and a segfault happens.
I don't know if there is an elegant way to fix this, but it's rather annoying ;)

tuan kuranes

30-11-2006 09:01:12

that lights something on my mind... but cannot recall what... you have to check where you can remove framelistener from, try inside frameEnded and frameStarted to see if one of these have a "anti-bug" feature in it.