Re: NSApplication delegate not released on quit?
Re: NSApplication delegate not released on quit?
- Subject: Re: NSApplication delegate not released on quit?
- From: publiclook <email@hidden>
- Date: Sat, 14 Jun 2003 09:52:06 -0400
On Saturday, June 14, 2003, at 04:31 AM, Greg Hurrell wrote:
El sabado, 14 juni, 2003, a las 14:08 Australia/Adelaide, Sherm
Pendley escribis:
A programmer who makes the quite reasonable assumption that NSApp
will release at dealloc time the things it previously retained, will
be bitten by this bug.
I'm making no such assumption. What I'm relying on is the
well-documented and predictable behavior of any modern
protected-memory OS, Mac OS X included.
It's well documented that resources are returned to the OS. I don't
dispute that for a second.
But it is NOT well documented that certain AppKit methods break the
basic pattern of balancing each "retain" message with a "release".
It isn't documented because they don't do it.
What if the code is ever ported to a platform where the (correct)
behaviour is maintained? Or to a platform where the OS doesn't do
the cleanup of leaked resources?
What I'm relying on *is* the correct behavior. Any OS that doesn't
reclaim the memory previously allocated to a program when that
program exits is either a museum piece, badly broken, or an extremely
mission-specific special case.
You've misread my post. Of course the OS is behaving correctly when it
reclaims memory. The incorrect behaviour I refer to is that of AppKit,
when it breaks the balanced retain/release paradigm.
Which it doesn't do.
And if it were corrected
It *was* corrected. Once upon a time, in classic MacOS and DOS-based
versions of Windows, it was possible to allocate memory that didn't
get returned to the OS until it was explicitly released by your code.
Again, see above. I'm not criticizing the way Mac OS X cleans up on
process termination; I'm criticizing AppKit for departing from an
established pattern.
Which it doesn't.
_______________________________________________
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.