Forum Discussion
cybereality
12 years agoGrand Champion
Minimal Oculus Application Tutorial
Hey guys! I put together this simple tutorial, showing the bare minimum code needed to work with the Oculus SDK. https://developer.oculus.com/wiki/index.php?title=Minimal_Oculus_Application I...
geekmaster
12 years agoProtege
"Gookanheimer" wrote:
I was just investigating my unhandled exception problem when I tried just getting rid of all my code and seeing if this minimal application worked instead, to try figure out where I'm going wrong. Lo and behold, this one appeared to work fine without any of the problems I'd had. But then I noticed something.
I tried setting a break point at the Clear() function in main(), and found that the program never actually makes it there because of the exit(0); line. If I replace the exit with a break;, then it does run the cleanup and I get the same unhandled exception problem I've been experiencing myself. Is using exit() without running the cleanup an acceptable way to end the program and something I would be able to use with my own one? So far it seems to be the only way around the problem.
Although it was important to free resources before shutting down in Windows 3.x, 32-bit Windows (Win 9x and newer) clean up and release resources for a program when the process terminates (even if you kill it with Task Manager). However, it is generally considered good practice to release all resources as soon as you are done with them, to prevent resource leaks when a program runs for a very long time (such as when running as a service or daemon in the Windows Tool Tray).
Although I did not study this problem, an unhandled exception could be caused by trying to free a resource that was already released, but there are many other potential causes as well. To prevent such problems, I like to check for non-zero pointers and handles before releasing them, and set them to zero or NULL after releasing them. That is the sort of bug I would look for first in the Clear() code.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 3 months ago
- 2 years agoAnonymous
- 3 months ago