diff -r becac012d502 -r 8a834943609d QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sat Jan 19 17:33:10 2013 -0500 +++ b/QTfrontend/main.cpp Sat Jan 19 17:46:06 2013 -0500 @@ -149,10 +149,11 @@ int main(int argc, char *argv[]) { + // Since we're calling this first, closeResources() will be the last thing called after main() returns. + atexit(closeResources); + #ifdef __APPLE__ - // This creates the autoreleasepool that prevents leaking, and destroys it only on exit - cocoaInit = new CocoaInitializer(); - atexit(closeResources); + cocoaInit = new CocoaInitializer(); // Creates the autoreleasepool preventing cocoa object leaks on OS X. #endif #ifndef _WIN32