Re: Instruments Leaks newbie question
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