I can think of two things causing this:
- Use of
#ifdef _DEBUG
somewhere in your code. - Relying on uninitialized variables, which may get initialized to 0 in debug mode, but have random values in release mode.
This SO question may also be of some help: Differences between running an executable with Visual Studio debugger vs without debugger