• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSXML & Auto Release Pools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXML & Auto Release Pools


  • Subject: Re: NSXML & Auto Release Pools
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 4 Feb 2009 11:25:33 -0700


On Feb 4, 2009, at 11:06 AM, Alan Shouls wrote:

I then get a warning NSCFString autoreleased with no pool in place - just
leaking


If, however I do things so that I release my NSXML object before releaseing
the Auto Release Pool - no message.


Does anyone have any insight into why this is happening and what might be
going on here?


You must be using the NSXML* class in its own thread. If you're using NSThread to detach a thread, and you are not using GC, then your threaded method is responsible for setting up its own autorelease pool, and keeping it active at all times. What's going on is releasing the object is apparently autoreleasing some other internal object, but since there's no pool in place, then the object gets leaked.

So you have to either wrap the entire method in its own pool, or use GC, or use the +[NSApplication detachDrawingThread:toTarget:withObject:] method, which is just like the similar NSThread method, but it makes the pool for you.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSXML & Auto Release Pools (From: Alan Shouls <email@hidden>)

  • Prev by Date: Re: [Q] Control over the "You cannot use the application ... with this version of Mac OS X" string
  • Next by Date: Re: [Q] Control over the "You cannot use the application ... with this version of Mac OS X" string
  • Previous by thread: NSXML & Auto Release Pools
  • Next by thread: Re: NSXML & Auto Release Pools
  • Index(es):
    • Date
    • Thread