• 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: Instruments Leaks newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instruments Leaks newbie question


  • Subject: Re: Instruments Leaks newbie question
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 19 Sep 2008 16:16:49 -0500

On Sep 19, 2008, at 3:53 PM, Glenn Bloom wrote:

Now here's my question: How come the Instruments leaks template identifies
all three leaks from inside the windowControllerDidLoadNib: method, but not
the one from inside main.m? Am I not configuring this template correctly?
Or am I offbase even asking this, as adding code to main.m would not be
normally required anyway?

Memory which you allocate and then never use again is not necessarily a leak. For it to be a leak, you have to actually lose track of it. A leak is memory that _can not_ be recovered because there is no remaining reference to it.


So, for the Duck instance in main, you still have a pointer to it. If you set the duckA variable to nil after logging it, then Leaks should report it as a leak.

The variables in windowControllerDidLoadNib: are local and lost when that method completes. That's why Leaks finds them.

Cheers,
Ken

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Instruments Leaks newbie question (From: "Glenn Bloom" <email@hidden>)

  • Prev by Date: Re: Custom component fails to load images by name in a IBPlugin
  • Next by Date: Re: Custom component fails to load images by name in a IBPlugin
  • Previous by thread: Instruments Leaks newbie question
  • Next by thread: Problems with deployment target when building with xcodebuild
  • Index(es):
    • Date
    • Thread