[File Tree Browser] Fix resource leak
These two objects were or could have been leaked previously. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
da8288eeee
commit
b03fdeaf7a
|
@ -29,9 +29,14 @@ NSURL *resolveAliases(NSURL *url) {
|
||||||
if(bookmarkRef) {
|
if(bookmarkRef) {
|
||||||
Boolean isStale;
|
Boolean isStale;
|
||||||
CFURLRef urlRef = CFURLCreateByResolvingBookmarkData(kCFAllocatorDefault, bookmarkRef, kCFURLBookmarkResolutionWithSecurityScope, NULL, NULL, &isStale, &error);
|
CFURLRef urlRef = CFURLCreateByResolvingBookmarkData(kCFAllocatorDefault, bookmarkRef, kCFURLBookmarkResolutionWithSecurityScope, NULL, NULL, &isStale, &error);
|
||||||
|
CFRelease(bookmarkRef);
|
||||||
|
|
||||||
if(urlRef && !isStale) {
|
if(urlRef) {
|
||||||
|
if(!isStale) {
|
||||||
return (NSURL *)CFBridgingRelease(urlRef);
|
return (NSURL *)CFBridgingRelease(urlRef);
|
||||||
|
} else {
|
||||||
|
CFRelease(urlRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue