QTfrontend/main.cpp
changeset 8406 8a834943609d
parent 8405 becac012d502
child 8508 f849b7b3af1d
--- 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