When debugging tools using "ObjectAlloc", I notice that 7 megabytes of memory is allocated to call renderInContext, but it is never released. When I comment on the call to renderInContext, this does not happen, and future calls to renderInContext do not continue to increase the allocation of memory.
UIGraphicsBeginImageContext(contentHolder.bounds.size);
[contentHolder.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Is there any way to make this memory free?
source
share