Merge pull request #8 from SDWebImage/bugfix_leak
Fix one leak of vImageConvertor
This commit is contained in:
commit
22d83f764e
|
@ -595,12 +595,14 @@
|
||||||
|
|
||||||
error = vImageBuffer_Init(&dest, height, width, destFormat.bitsPerPixel, kvImageNoFlags);
|
error = vImageBuffer_Init(&dest, height, width, destFormat.bitsPerPixel, kvImageNoFlags);
|
||||||
if (error != kvImageNoError) {
|
if (error != kvImageNoError) {
|
||||||
|
vImageConverter_Release(convertor);
|
||||||
CFRelease(dataRef);
|
CFRelease(dataRef);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert input color mode to RGB888/RGBA8888
|
// Convert input color mode to RGB888/RGBA8888
|
||||||
error = vImageConvert_AnyToAny(convertor, &src, &dest, NULL, kvImageNoFlags);
|
error = vImageConvert_AnyToAny(convertor, &src, &dest, NULL, kvImageNoFlags);
|
||||||
|
vImageConverter_Release(convertor);
|
||||||
if (error != kvImageNoError) {
|
if (error != kvImageNoError) {
|
||||||
CFRelease(dataRef);
|
CFRelease(dataRef);
|
||||||
return nil;
|
return nil;
|
||||||
|
|
Loading…
Reference in New Issue