Re: GC pros and cons
Re: GC pros and cons
- Subject: Re: GC pros and cons
- From: Kyle Sluder <email@hidden>
- Date: Wed, 24 Jun 2009 20:11:34 -0700
On Wed, Jun 24, 2009 at 7:55 PM, Peter Ammon<email@hidden> wrote:
> Microsoft even says that all objects must be robust against being Dispose()d
> multiple times, which smacks of sloppiness. If your program disposes of an
> object twice, then it is structured so that independent usages of the object
> are not coordinated, and so it is likely that one part of your program uses
> an object after it has been disposed by another part.
It's not really sloppiness. Python behaves the same way with its
contexts; both Python contexts and Dispose() are intended to be used
on objects that hold on to finite resources. Similarly to Dispose(),
you can't reopen a closed NSStream.
IOW, Dispose() isn't a memory management technique, it's a
limited-resource-management technique.
--Kyle Sluder
_______________________________________________
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