• 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: release not done right away
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: release not done right away


  • Subject: Re: release not done right away
  • From: j o a r <email@hidden>
  • Date: Wed, 21 Apr 2004 12:50:32 +0200

On 2004-04-21, at 12.35, Nicolas Berloquin wrote:

> Humm, I really thought that all the instances that hold to these
> objects would release them before my "final" release, (I knew about
> what you describe), but I will check my code to see if by any chance
> one of them is not autoreleased.

Keep in mind that things might be autoreleased by the frameworks
"behind your back", as part of the normal operations of Cocoa.

> btw is there any way to tell the main runloop to release its pool even
> when no event are
> processed ? Imagine if the app runs a few hours in the background,
> keeping and keeping tons
> of autoreleased objects waiting to be done with ? (My app does not
> need to be in the
> foreground to create those objects).

The autorelease pools is flushed regardless of if your app is in the
foreground or not. I would have expected the default pool to be flushed
at the *end* of the event loop, not at the beginning of next event
loop. I could be wrong, but I hope I'm not.

If you're generating autoreleased objects *outside* of normal event
loop processing, or if you keep one event loop running for a *very*
long time, you might have to manage your own autorelease pools, to be
able to pop them when it suits you.

j o a r

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >release not done right away (From: Nicolas Berloquin <email@hidden>)
 >Re: release not done right away (From: j o a r <email@hidden>)
 >Re: release not done right away (From: Nicolas Berloquin <email@hidden>)

  • Prev by Date: Re: release not done right away
  • Next by Date: NSCell's editWithFrame method
  • Previous by thread: Re: release not done right away
  • Next by thread: Re: release not done right away
  • Index(es):
    • Date
    • Thread