SDL: Program works in Debug config, but fails in Release

Started by
1 comment, last by CrimsonMemory 17 years, 10 months ago
This has never happened to me before: my program runs just perfectly in the debug config, but when I set it to Release config (yes, I put all the settings to match those of SDL, like the multi-threaded DLL and stuff like that), it runs much differently! Let me try to explain. My program is simply a sprite on the screen that moves along with the arrow keys, and when an arrow key is being pushed, the sprite animates. This works correctly in debug, but when I run it in Release, the sprite moves around with the keys, but it doesn't animate! It's so weird that everything works perfectly fine except for that nuance. Really, I'm not sure what kind of source code to give you, because this is such an unusual problem; none of the code is wrong, because it works under Debug, but Release just doesn't like it! Honestly, I don't know the first place to look in my code! I'm honestly thinking of just posting ALL of my code, but that seems immoral. So, has ANYONE ever encountered this sort of situation (that is, the disagreement between Debug and Release configs)? If so, are there any factors I should look into that most often contribute to this sort of problem? I really don't want to resort to posting the entirety of my code (which isn't really all THAT much), but if nobody has run into a problem of this sort before, and it's necessary to post it, I will. PLEASE, just ask, if that's the case. I apologize for all that reading you had to do, so THANK YOU just for reading of my plight, and then thanks in advance for any help I can get out of this. It would be greatly appreciated.
I jumped in a river and what did I see? Black-eyed angels swam with me.- Thom Yorke
Advertisement
I believe the biggest issue Debug->Release is uninitialized variables.

Check for those as the debug version can set them to safe values. The release goes for speed and will just allow you to have uninitialized variables.
Boder, that was it! I was stupidly referencing a few class members that had never been initialized! Wow, what a freakin' relief. Thanks a LOT for the help!
I jumped in a river and what did I see? Black-eyed angels swam with me.- Thom Yorke

This topic is closed to new replies.

Advertisement