Re: String memory leak
Re: String memory leak
- Subject: Re: String memory leak
- From: Bruce Truax <email@hidden>
- Date: Sun, 02 Apr 2006 20:10:33 -0500
- Thread-topic: String memory leak
On 4/2/06 10:44 AM, "Scott Ribe" <email@hidden> wrote:
>> I am obviously
>> doing something wrong so I guess it is time to go back and study the code
>> some more.
>
> Does setGlass retain the string? Does your dealloc method properly release
> it?
Yes it does. Here is my getter and setter methods:
- (NSString *)glass {
return [[glass retain] autorelease];
}
- (void)setGlass:(NSString *)newGlass {
if (glass != newGlass) {
[glass release];
glass = [newGlass copy];
}
}
Bruce
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden