Debug vs. Release in VS 2005 DirectX9

Started by
3 comments, last by DesignerX 17 years ago
Why when running my application in debug mode everything is running fine but when switching to release mode the following happens : - My loop for checking if a key is pressed never exists (it seems that a key is always pressed for an unkown reasons, NOT happen with debug mode), I'm using DirectInput for that. - My application crashes upon exit. I have no idea why this is so, can anyone explain ? thx.
There is nothing that can't be solved. Just people that can't solve it. :)
Advertisement
Define "crashes". What's the exact error? If it's an access violation, is it reading or writing, and what address?
There could be several reasons for this, caused by code getting optimized away or debug mode adding data which is not there for a release mode build etc. We need to see your code in order to tell.

You could check out for example (just a few hits I googled, there are many more I'm sure):
Debugging Release Mode Problems
Visual C++ Debugging: Why does program work in debug mode, but fail in release mode?
Best regards, Omid
Amazingly, that article linked by Omid dismisses the single biggest difference between debug and release builds.

In debug builds, variables are often initialized for you. In release, they are not. Release follows the proper behavior. All the times I've had this problem, it's been because of an uninitialized variable.

Or I could read the whole thing instead of just the summary. I still blame the author. ...

[Edited by - Deyja on April 23, 2007 6:22:13 AM]
I thank you all for your replies. I'll sure look into these articles.

Evil Steve, I get the Don't Send/Send win32 error message without any information about the crash. (You know, the "We sorry for the innconvinience but this program must be closed....)
There is nothing that can't be solved. Just people that can't solve it. :)

This topic is closed to new replies.

Advertisement