Fixed messages complaining about no autorelease pool being set up with objects leaking on the Mac. I simply initialized an autorelease pool in the couple of places that needed it.
authorZorg <zorgiepoo@gmail.com>
Sun, 03 Apr 2011 00:13:38 -0400
changeset 5083 b0b560f561b5
parent 5082 2d2422772832
child 5085 e8944ed92b61
Fixed messages complaining about no autorelease pool being set up with objects leaking on the Mac. I simply initialized an autorelease pool in the couple of places that needed it.
QTfrontend/M3Panel.mm
QTfrontend/SDLs.cpp
--- a/QTfrontend/M3Panel.mm	Sat Apr 02 12:52:19 2011 -0400
+++ b/QTfrontend/M3Panel.mm	Sun Apr 03 00:13:38 2011 -0400
@@ -18,6 +18,7 @@
 
 #include "M3Panel.h"
 #include "M3InstallController.h"
+#include "CocoaInitializer.h"
 
 #include <Cocoa/Cocoa.h>
 
@@ -30,7 +31,8 @@
 M3Panel::M3Panel(void)
 {
 	c = new Private;
-
+    
+    CocoaInitializer initializer;
 	c->install = [[M3InstallController alloc] init];
 	[c->install retain];
 
--- a/QTfrontend/SDLs.cpp	Sat Apr 02 12:52:19 2011 -0400
+++ b/QTfrontend/SDLs.cpp	Sun Apr 03 00:13:38 2011 -0400
@@ -24,6 +24,10 @@
 
 #include <QApplication>
 
+#ifdef __APPLE__
+#include "CocoaInitializer.h"
+#endif
+
 
 extern char sdlkeys[1024][2][128];
 extern char xb360buttons[][128];
@@ -33,7 +37,11 @@
 
 SDLInteraction::SDLInteraction()
 {
-
+#ifdef __APPLE__
+    // SDL_Init needs a NSAutoreleasePool set up
+    CocoaInitializer initializer;
+#endif
+    
     SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
 
     musicInitialized = 0;