mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Simplify CFSearchpathForDirectoriesInDomains - one less leak - not
out of the woods yet though
This commit is contained in:
parent
722e36001f
commit
8e46e46a40
@ -128,28 +128,12 @@ static void CFSearchPathForDirectoriesInDomains(
|
||||
#else
|
||||
NSSearchPathDirectory dir = NSDocumentDirectory;
|
||||
#endif
|
||||
CFTypeRef array_val = (CFTypeRef)CFBridgingRetainCompat(
|
||||
CFTypeRef array_val = (CFTypeRef)CFBridgingRetainCompat([
|
||||
NSSearchPathForDirectoriesInDomains(dir,
|
||||
NSUserDomainMask, YES));
|
||||
NSUserDomainMask, YES) firstObject]);
|
||||
|
||||
if (array_val)
|
||||
{
|
||||
CFArrayRef array = CFRetain(array_val);
|
||||
CFTypeRef path_val = (CFTypeRef)CFArrayGetValueAtIndex(array, 0);
|
||||
|
||||
if (path_val)
|
||||
{
|
||||
CFStringRef path = CFRetain(path_val);
|
||||
if (path)
|
||||
{
|
||||
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
|
||||
CFRelease(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (array)
|
||||
CFRelease(array);
|
||||
}
|
||||
CFStringGetCString(array_val, s, len, kCFStringEncodingUTF8);
|
||||
}
|
||||
|
||||
static void CFTemporaryDirectory(char *s, size_t len)
|
||||
|
Loading…
x
Reference in New Issue
Block a user