程序中起了一个线程来调用某updataData的方法
[xxAdManager performSelectorInBackground: @selector(updateData) withObject: nil];
|
结果出现了内存泄露的提示:
class xxxx autoreleased with no pool in place - just leaking
解决方法:
在updataData方法中最前端和最后端增加AutoReleasePool即可
+(void) updateData
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
xxxx
[pool release];
}
|
阅读(2415) | 评论(1) | 转发(0) |