Page 1 of 1

calling Shutdown() causes crash ?

PostPosted: Oct 10, 2002 @ 4:08pm
by Conan
until now I had Shutdown() being called on a button press but now when I call a function from my game menu which itself calls Shutdown() the game crashes with an illegal operation.

If FMOD music is playing the iPaq needs a soft reset

I tried calling Shutdown() from the main loop and that also crashes so it's nothing to do with where my menu functions are ???

Has anyone seen a Shutdown problem like this?

thanks in advance

PostPosted: Oct 10, 2002 @ 4:51pm
by Pam

PostPosted: Oct 10, 2002 @ 7:01pm
by draklava
also the reverse of what Pam said...

If you call delete on something that was never instantiated it will crash...

can you step through the shutdown and see what line it is crashing on?

Stepping through Shutdown

PostPosted: Oct 10, 2002 @ 7:09pm
by Conan
I can try to step through but this debugger is new to me. The thing which puzzles me is that the same function called from the button down function works fine.

Thanks for the suggestions

PostPosted: Oct 10, 2002 @ 8:28pm
by Kzinti
This will usually happen if you try to use a surface after the system was shutdown... For example, trying to draw anything to the display after a call to Shutdown() will bomb like that.

Calling Shutdown() from the main loop or a button down event shouln't be different... Shutdown() is basically posting a WM_QUIT message to the window and does nothing else... Actual shutdown happens when the message is processed, which is always at the same time (between game loops).

making shutdown work

PostPosted: Oct 10, 2002 @ 9:00pm
by Conan
I have changed my code so that the call to Shutdown() happens in the stylus checking function where it's known to work from.

Looks like Shutdown can be a probelm if not called from the button or stylus functions ???

Anyway as I have a workaround I will get back to coding.

PostPosted: Oct 10, 2002 @ 10:46pm
by Pam
Is your game menu and the function you call in the same class as the one you inherit from Game?

If not, you may have some kind of circular reference thing happening, which is why it doesn't work in your menu but still works in the button or stylus overrides.

Pam

class where menu is etc

PostPosted: Oct 10, 2002 @ 11:31pm
by Conan

PostPosted: Oct 12, 2002 @ 4:08am
by Jay Mattis

PostPosted: Oct 12, 2002 @ 4:19am
by Kzinti

thx

PostPosted: Oct 13, 2002 @ 12:53am
by tdz