#objective-c #memory
#цель-c #память
Вопрос:
CGColorSpaceRef colorspace = CGImageGetColorSpace(image);
CGContextRef context = CGBitmapContextCreate(NULL, width, height,
CGImageGetBitsPerComponent(image),
CGImageGetBytesPerRow(image),
colorspace,
CGImageGetAlphaInfo(image));
CGColorSpaceRelease(colorspace);
if(context == NULL)
return nil;
CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
CGImageRef imgRef = CGBitmapContextCreateImage(context);
CGContextRelease(context);
Это мой полный код….
Ответ №1:
CGBitmapContextCreate возвращает объект с помощью операции КОПИРОВАНИЯ. Тебе тоже нужно это отпустить. вы должны вызвать cgcontexttrelease в контексте.