• 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: Observing with GC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Observing with GC


  • Subject: Re: Observing with GC
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 26 Feb 2008 10:51:09 -0500
  • Organization: Rogue Research

On 2/26/08 12:01 AM, Quincey Morris said:

>On Feb 25, 2008, at 21:08, Bill Bumgarner wrote:
>
>> In general, -finalize should not be used to manage scarce resource
>> nor muck around with the app's object graph, including tearing down
>> observations and the like.
>
>
>I find it hard to see anything dangerous in the finalize strategy used
>in the above code, unless:

Don't forget that -finalize methods must be thread-safe.  Your example:

- (void) finalize {
	if (observer)
		[self removeObserver: observer forKeyPath: @"name"];
	[super finalize];
}

Is removeObserver:forKeyPath: documented to be threadsafe?  After a
quick search, I find it hard to tell.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

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

  • Follow-Ups:
    • Re: Observing with GC
      • From: Graham <email@hidden>
References: 
 >Observing with GC (From: Quincey Morris <email@hidden>)
 >Re: Observing with GC (From: Rob Keniger <email@hidden>)
 >Re: Observing with GC (From: glenn andreas <email@hidden>)
 >Re: Observing with GC (From: Rob Keniger <email@hidden>)
 >Re: Observing with GC (From: Bill Bumgarner <email@hidden>)
 >Re: Observing with GC (From: Quincey Morris <email@hidden>)

  • Prev by Date: Animated button
  • Next by Date: Re: Spotlight Importer
  • Previous by thread: Re: Observing with GC
  • Next by thread: Re: Observing with GC
  • Index(es):
    • Date
    • Thread