From d4b71c89580d6a859060b3f663c11e99fdba3221 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 18 Nov 2013 06:18:51 -0400 Subject: [PATCH] =?UTF-8?q?Tighter=20memory=20management=20when=20checking?= =?UTF-8?q?=20for=20.love=20files=20in=20the=20Mac=20application=E2=80=99s?= =?UTF-8?q?=20Resources=20folder.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xcode 4.2 or greater is now required to build LÖVE in OS X --- platform/macosx/OSX.mm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/platform/macosx/OSX.mm b/platform/macosx/OSX.mm index 070814515..9e63b2628 100644 --- a/platform/macosx/OSX.mm +++ b/platform/macosx/OSX.mm @@ -32,12 +32,15 @@ std::string getLoveInResources() { std::string path; - // check to see if there are any .love files in Resources - props to stevejohnson/diordna - NSArray *lovePaths = [[NSBundle mainBundle] pathsForResourcesOfType:@"love" inDirectory:nil]; - if ([lovePaths count] > 0) + @autoreleasepool { - NSString *firstLovePath = [lovePaths objectAtIndex:0]; - path = std::string([firstLovePath UTF8String]); + // check to see if there are any .love files in Resources - props to stevejohnson/diordna + NSArray *lovePaths = [[NSBundle mainBundle] pathsForResourcesOfType:@"love" inDirectory:nil]; + if ([lovePaths count] > 0) + { + NSString *firstLovePath = [lovePaths objectAtIndex:0]; + path = std::string([firstLovePath UTF8String]); + } } return path;