fix memory leak in Cocoa icon decoder. b=342066 r=mento sr=pav

This commit is contained in:
joshmoz%gmail.com 2006-06-20 16:59:15 +00:00
parent 4a103cc93d
commit 2cacb70302

View File

@ -259,8 +259,10 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBloc
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
CFURLRef macURL; CFURLRef macURL;
if (NS_SUCCEEDED(localFileMac->GetCFURL(&macURL))) if (NS_SUCCEEDED(localFileMac->GetCFURL(&macURL))) {
iconImage = [[NSWorkspace sharedWorkspace] iconForFile:[(NSURL*)macURL path]]; iconImage = [[NSWorkspace sharedWorkspace] iconForFile:[(NSURL*)macURL path]];
::CFRelease(macURL);
}
} }
// try by HFS type if we don't have an icon yet // try by HFS type if we don't have an icon yet