다른 누구도이 문제를 겪고 있습니까? 나는 NSTimer로 꽤 자주 이미지 크기를 조정하고있다. 인스트루먼트를 사용하면 메모리 누수가 표시되지 않지만 objectalloc은 계속 올라갑니다. CGBitmapContextCreateImage를 직접 가리 킵니다.iPhone - CGBitmapContextCreateImage 누출,이 문제가있는 사용자는 누구입니까?
누구나 해결책을 알고 계십니까? 또는 심지어 가능한 아이디어? 그냥 전성 검사
-(UIImage *) resizedImage:(UIImage *)inImage : (CGRect)thumbRect : (double)interpolationQuality
{
CGImageRef imageRef = [inImage CGImage];
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef);
if (alphaInfo == kCGImageAlphaNone)
alphaInfo = kCGImageAlphaNoneSkipLast;
// Build a bitmap context that's the size of the thumbRect
CGContextRef bitmap = CGBitmapContextCreate(
NULL,
thumbRect.size.width,
thumbRect.size.height,
CGImageGetBitsPerComponent(imageRef),
4 * thumbRect.size.width,
CGImageGetColorSpace(imageRef),
alphaInfo
);
// Draw into the context, this scales the image
CGContextSetInterpolationQuality(bitmap, interpolationQuality);
CGContextDrawImage(bitmap, thumbRect, imageRef);
// Get an image from the context and a UIImage
CGImageRef ref = CGBitmapContextCreateImage(bitmap);
UIImage* result = [UIImage imageWithCGImage:ref];
CGContextRelease(bitmap); // ok if NULL
CGImageRelease(ref);
return [result autorelease];
}
나는 실제로 그 코드를 몇 분 전에 코드에 추가했다. CGBitmapContextCreate가 내 objectalloc을 살인하고 있습니다. – bbullis21