Accidentally left atexit() inside a mac-only section in last revision (rbecac012d502)
authordag10 <gottlieb.drew@gmail.com>
Sat, 19 Jan 2013 17:46:06 -0500
changeset 8406 8a834943609d
parent 8405 becac012d502
child 8407 686f2e716c97
Accidentally left atexit() inside a mac-only section in last revision (rbecac012d502)
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