My main() looks like this. Does yours specify an autorelease pool?

int main(int argc, char* argv[])
{
        @autoreleasepool
        {
                return UIApplicationMain(argc, argv, nil, 
@"MyDelegateClassName");
        }
}


On Jun 19, 2014, at 5:45 PM, Varun Chandramohan <varun.chandramo...@wontok.com> 
wrote:

> I was playing around with OBJ_DEBUG_MISSING_POOL env variable and set it to 
> YES. I was able to debug most of the issues in my code where I missed auto 
> release pools. This is the last one remaining. However I am not sure where 
> the leak is happening. It looks like NSApplicationMain, do that also need 
> this auto release pool?
> 
> objc[26109]: MISSING POOLS: Object 0x6180000410e0 of class NSUserDefaults 
> autoreleased with no pool in place - just leaking - break on 
> objc_autoreleaseNoPool() to debug
> 
> (lldb) bt
> 
> * thread #1: tid = 0x3d3c5f, 0x00007fff91da8604 
> libobjc.A.dylib`objc_autoreleaseNoPool, queue = 'com.apple.main-thread', stop 
> reason = breakpoint 1.1
>    frame #0: 0x00007fff91da8604 libobjc.A.dylib`objc_autoreleaseNoPool
>    frame #1: 0x00007fff91d95488 libobjc.A.dylib`(anonymous 
> namespace)::AutoreleasePoolPage::autoreleaseSlow(objc_object*) + 72
>    frame #2: 0x00007fff91da8781 
> libobjc.A.dylib`_objc_rootAutorelease2(objc_object*) + 75
>    frame #3: 0x00007fff895528a3 AppKit`_NSGetBoolAppConfig + 85
>    frame #4: 0x00007fff89571566 AppKit`-[NSApplication 
> _installMemoryPressureDispatchSources] + 161
>    frame #5: 0x00007fff89565861 AppKit`-[NSApplication run] + 206
>    frame #6: 0x00007fff895507a3 AppKit`NSApplicationMain + 940
>  * frame #7: 0x0000000100002022 TOS`main(argc=3, argv=0x00007fff5fbffa90) + 
> 34 at main.m:13

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to