Alright I am having a world of difficulty tracking down this memory leak. When running this script I do not see any memory leaking, but my objectalloc is climbing. Instruments points to CGBitmapContextCreateImage > create_bitmap_data_provider > malloc, this takes up 60% of my objectalloc.
This code is called several times with a NSTimer.
How do I clear that reUIImage after I return it?
...or How can I make it so that UIImage imageWithCGImage does not build my ObjectAlloc?
//I shorten the code because no one responded to another post
//Think my ObjectAlloc is building up on that retUIImage that I am returning
//**How do I clear that reUIImage after the return?**
-(UIImage) functionname {
//blah blah blah code
//blah blah more code
UIImage *retUIImage = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);
return retUIImage;
}
this method you use instantiates a UIImage and sets it as autorelease. If you want to cleanup these, you will need to empty the pool periodically
Note that these can be nested:
Common practice is to place these around for loops and other methods that make many autoreleased objects.