I have this in my main.m:
printf("make autorelease pool \n");
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"MyAppDelegate");
[pool release];
return retVal;
And i suddenly started to get this when I run my app on the simulator:
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(): Object 0x49110c0 of class NSPathStore2 autoreleased with no pool in place – just leaking
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(): Object 0x4911ce0 of class NSPathStore2 autoreleased with no pool in place – just leaking
Stack: (0xe171f 0x58d64 0x6902e 0x445545 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057)
make autorelease pool
Does anyone have any idea what’s causing this?
Any help much appreciated!
I think I found what was causing it. I have a method to load my textures and its signature looked like this +(void)load Apparently, this gets called at app startup even if you don’t import the file containing the method anywhere. Changing the signature to +(void)loadTexture prevents it from being called prematurely, thereby fixing the “bug”!
Sorry for answering my own question. I hope this saves someone’s time.