Jump to content
  • Advertisement
Sign in to follow this  
disanti

Strange crash on exit.

This topic is 3993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm working on a game using the Ogre graphics engine, and out of no where it is now crashing when I exit. The weirdest part is that it crashes after I return 0 from WinMain, and the debugger is giving me the crashing line from crt0dat.c (the debugger callstack has a bunch of CRT0 calls, none of my functions): ExitProcess(status); I have no idea why this would crash, I've made sure I didn't delete any objects twice by replacing all of my delete commands with a macro that sets the pointer to 0 after deleting it. Could any one give me ideas as to what to look for to fix this crash? Could it be a heap/stack problem? I don't know exactly what would cause it, and I've searched Google for an hour now. I'm getting pretty frustrated. Oh, and one more thing, Window's error reporting says that the crash is inside of OgreMain.dll despite the crash happening in my application's CRT0 after WinMain returns. The Ogre log reports absolutely nothing that could have gone wrong, so I'm thinking its probably a false lead. The log also shows that the Ogre clean up finishes successfully. Thanks. :) Edit: I have also tried a complete rebuild of the project to see if that'd fix anything. Note that no compiler settings had been changed prior to the crash.

Share this post


Link to post
Share on other sites
Advertisement
That shouldn't be a major problem because it's already exiting, but I'll still try to help you.

I haven't had much personal experience with OGRE, so I'm afraid I can't help you much. However, from my past experience, I do have a two possible solutions. Double check your clean-up functions, as the problem might be forgetting to release a device, or another clean-up function. If you are sure that you are cleaning up properly, check that your OGRE version is up to date.

Share this post


Link to post
Share on other sites
I think it's memory leak problem, and probably Ogre enable memory leak detection using crt functions.
Is the crashing occur only on debug mode? and check the output window for error messages.

Read more about leak detection :
http://msdn2.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx

Share this post


Link to post
Share on other sites
The crash is happening in Release mode (with debug information) as I can't even get my game to run with true Debug mode (dunno why.)

I haven't run it with debug mode for a couple months now, and do all of my debugging through release mode. Some setting in debug mode has been making it crash before it even starts WinMain.

I'll look into memory leaks though.

Share this post


Link to post
Share on other sites
OK, I spent an hour getting the debug build to actually run, and now I'm downloading the source code to Ogre so I can really get down and dirty with the debugger. I've narrowed the problem down to something in my game's scene as only my single player game state causes the crash, if I only enter a title screen or anything else it works without crash.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!