瀏覽代碼

Fixed SDLMain leaking in OS X

Alex Szpakowski 12 年之前
父節點
當前提交
74ca349895
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      platform/macosx/SDLMain.m

+ 4 - 0
platform/macosx/SDLMain.m

@@ -402,6 +402,8 @@ int main (int argc, char **argv)
 		gFinderLaunch = NO;
 	}
 
+	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
 	/* check to see if there are any .love files in Resources - props to stevejohnson/diordna */
 	NSArray *lovePaths = [[NSBundle mainBundle] pathsForResourcesOfType:@"love" inDirectory:nil];
 
@@ -448,6 +450,8 @@ int main (int argc, char **argv)
 		gArgv[gArgc] = NULL;
 	}
 
+	[pool drain];
+
 #if SDL_USE_NIB_FILE
 	[SDLApplication poseAsClass:[NSApplication class]];
 	NSApplicationMain (argc, argv);