Re: release not done right away
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.