【发布时间】:2010-08-27 09:20:51
【问题描述】:
我的 main.m 中有这个:
printf("make autorelease pool \n");
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"MyAppDelegate");
[pool release];
return retVal;
当我在模拟器上运行我的应用程序时,我突然开始明白这一点:
2010-08-27 11:09:35.909 MyApp[6224:207] *** _NSAutoreleaseNoPool(): Object 0x49107c0 of class NSPathStore2 autoreleased with no pool in place - just leaking
Stack: (0xe171f 0x58d64 0x59ebd 0x599ee 0x600c7 0x31d016 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057)
2010-08-27 11:09:35.911 MyApp[6224:207] *** _NSAutoreleaseNoPool(): NSPathStore2 类的对象 0x49110c0 自动释放,没有适当的池 - 只是泄漏 Stack: (0xe171f 0x58d64 0x5cd69 0x60335 0x601f1 0x31d016 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057)
2010-08-27 11:09:35.912 MyApp[6224:207] *** _NSAutoreleaseNoPool(): NSPathStore2 类的对象 0x4911ce0 自动释放,没有适当的池 - 只是泄漏 堆栈:(0xe171f 0x58d64 0x6902e 0x445545 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe07950 0x8fe07950 0x8fe0d30a 0x8fe0d3d1) 制作自动释放池
有人知道是什么原因造成的吗? 非常感谢任何帮助!
【问题讨论】:
标签: objective-c memory-management ios-simulator