xtreampb Posted November 9, 2013 Share Posted November 9, 2013 Hi all. I just attempted to publish a prototype to windows. I'm running win 8.1 64 bit. My debug runs fine from the IDE. When i tried to run in the release configuration, it threw a runtime error once the map was loaded. the error was an access violation error. Can anyone help provide guidance on this matter Thanks, ~xtreampb~ Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Josh Posted November 10, 2013 Share Posted November 10, 2013 On the occasion that this happens, the problems are hard to track down. Uninitialized pointers and writing outside the bounds of an array are two common causes. Is this C++ or Lua? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted November 11, 2013 Share Posted November 11, 2013 You are most likely using a pointer that points to nothing. You could put some logging in your game and start narrowing it down to where it's happening. I usually put some printf()'s in major sections of my game and then start putting printf()'s in a more specific area as things narrow down. Quote Link to comment Share on other sites More sharing options...
xtreampb Posted November 11, 2013 Author Share Posted November 11, 2013 this is in C++. If it was a pointer or written outside of bounds issue wouldn't it also crash in the debug mode, or at least launch the debugger. It is only throwing any run time errors when i run the release version of the exact same source code. Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Rick Posted November 11, 2013 Share Posted November 11, 2013 That almost always means a variable isn't initialized correctly. My guess is finding this bug and if it's an init issue, you'll always init every variable from now on if you don't already Read the first answer to this to understand more. http://stackoverflow.com/questions/312312/what-are-some-reasons-a-release-build-would-run-differently-than-a-debug-build 1 Quote Link to comment Share on other sites More sharing options...
xtreampb Posted November 11, 2013 Author Share Posted November 11, 2013 Thanks for the link. Learned something new. Time to ensure all my vars are intialized before use. Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Josh Posted November 11, 2013 Share Posted November 11, 2013 You probably realize this, pointers are the only thing you really need to worry about, and only for the purpose of preventing yourself from calling a function on a non-existent object. It's only a way to help prevent user error, they don't actually have to be initialized if you don't make any mistakes. Another trick is to look at the object's ref count and check the collected value. If the object's refcount is either zero or some huge crazy number, it's probably an invalid object. If the collected member is true, it was probably deleted. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted November 11, 2013 Share Posted November 11, 2013 For normal C++ stuff, all pointers should be set to null when finished with them and before accessing you should also check against null before trying to use it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.