Fix memory leak warning (autorelease pool) on OSX. [Couriersud]

This commit is contained in:
couriersud 2015-02-26 01:38:49 +01:00
parent 0fd2001a67
commit 2c2994aeb5

View File

@ -20,12 +20,17 @@ static char *StringToChar(NSString *str)
char *FindPrefsDir(void)
{
char *resstr = NULL;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES);
if ([paths count] > 0)
{
resstr = StringToChar([paths objectAtIndex:0]) ;
}
[pool release];
return resstr;
}
#endif