Crash on Quit

My app works fine and runs as it should, but when quitting it it crashes and kills all around it! Is this ogl/glut having problems cleaning up memory? Anyone else had these probs?



Easiest thing to do is start with a basic GLUT app from the SDK (like glutmech). We know it doesn’t crash, so it’s most likely not a GLUT prob.

Then, using this code as a starting point, add your code bit by bit, and test incrementally. As soon as your app starts killing things on quit, then you’ll have a better idea of what code caused the mishap.


I get dumped into the depths of the ATI driver code in Macsbug whenever I exit several of the Mac OpenGL SDK demo apps. You are not alone )

Gavin et al

I too have experienced these problems, ie big time crash when quiting a glut based program from menubar

It only happens if I choose quit from the menubar. If I provide a “hit Q to quit” keyboard routine and exit(0) in that routine, everything works fine.

Any better solutions/workarounds?


I may have figured it out. I noticed that the one of the glut based examples I had that worked included a line after glutCreateWindow(“colorcube”)


adding this to my crahsing sample fixed it. Other examples I had that worked passed the display function in glutIdleFunc, ie glutIdleFunc(myDisplay)

hope that helps


I am using an Idle Function though, not the display, but some other processing stuff. Anyone get any interesting error logs with it?


I installed Mac OS X (Japanese language version) few days ago. Then my glut app began to crush on quit on Mac OS 9.0.4. The app ran fine before.
Mac OS X Installer adds/replaces some system files and OpenGL library(s) in the extension folder of Mac OS 9 for ‘Classic environment compatibility’.
I uninstalled Mac OS X, and restored all replaced system files in Mac OS 9.0.4 system folder.
Now my glut app runs fine.

This is my case.
I use CodeWarrior 6.

Mybe it as I did have mac osx, and have removed it, maybe a os reinstall might help…

i’ll let you know

Well, just compiled on unix/irix to see whats going on a bit better, no crash, no xmesa error message, no error log. Then recomile on mac, run, quite, RESTART, arrgghh


I assume that you are all on the mac-opengl mailing list. It appears that it was the classic rave that was causing my app to die on quit, as it is know fine, and happy…


I had a problem like that (crashing when quit from the menu item) in an app I made, the solution was simple:

create a variable that flags when you want to quit.

instead of quitting right on the menu action, set that variable to true.

at the end of your main loop, if that variable is true, quit.

hope this is some help.

See my last post, it may help you as well! :slight_smile:


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.