# HG changeset patch
# User dag10 <gottlieb.drew@gmail.com>
# Date 1358635566 18000
# Node ID 8a834943609d5b28c90f154318334e38418fc3bb
# Parent  becac012d5025a5aac1e47017a695db5c95f6176
Accidentally left atexit() inside a mac-only section in last revision (rbecac012d502)

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