Commits

Alex Szpakowski committed 50aef1f

Tighter memory management when checking for .love files in the Mac application’s Resources folder.

Xcode 4.2 or greater is now required to build LÖVE in OS X

Comments (1)

Files changed (1)

platform/macosx/OSX.mm

 {
 	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;