Вопрос

I'm calling

CGImageRef tmp = CGImageCreateWithImageInRect([self.originalImage CGImage], newSize);

a ton of times and the app is eventually crashing but I don't retain a reference to the image. Shouldn't tmp get garbage collected?

The error is an EXC_BAD_ACCESS

Это было полезно?

Решение

Even in ARC, this function doesn't clean up after itself.

After you call it, use this:

CGImageRelease(tmp);
tmp = NULL;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top