• 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: NSApplication delegate not released on quit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSApplication delegate not released on quit?


  • Subject: Re: NSApplication delegate not released on quit?
  • From: Greg Hurrell <email@hidden>
  • Date: Sat, 14 Jun 2003 18:01:46 +0930

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".

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.

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.

Cheers
Greg
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSApplication delegate not released on quit?
      • From: "Dennis C.De Mars" <email@hidden>
    • Re: NSApplication delegate not released on quit?
      • From: publiclook <email@hidden>
    • Re: NSApplication delegate not released on quit?
      • From: Finlay Dobbie <email@hidden>
References: 
 >Re: NSApplication delegate not released on quit? (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Cocoa's custom class delegate conventions
  • Next by Date: Re: View system usage with lower left origin (corrected)
  • Previous by thread: Re: NSApplication delegate not released on quit?
  • Next by thread: Re: NSApplication delegate not released on quit?
  • Index(es):
    • Date
    • Thread