【发布时间】:2009-09-15 23:45:11
【问题描述】:
好吧,我很难追踪这个内存泄漏。运行此脚本时,我没有看到任何内存泄漏,但我的 objectalloc 正在攀升。 Instruments 指向 CGBitmapContextCreateImage > create_bitmap_data_provider > malloc,这占了我objectalloc的60%。
这段代码被 NSTimer 调用多次。
reUIImage 退回后如何清除?
...或者我怎样才能使 UIImage imageWithCGImage 不构建我的 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;
}
【问题讨论】:
标签: iphone memory-leaks uiimage cgbitmapcontextcreate