From 74ca349895b7a58ba7582f24b5c272bc9ec07eb2 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 19 Mar 2013 11:53:57 -0300 Subject: [PATCH] Fixed SDLMain leaking in OS X --- platform/macosx/SDLMain.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/macosx/SDLMain.m b/platform/macosx/SDLMain.m index b696b9673..57d890b8f 100644 --- a/platform/macosx/SDLMain.m +++ b/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);