RE: Why does this leak memory?
RE: Why does this leak memory?
- Subject: RE: Why does this leak memory?
- From: Jeff Laing <email@hidden>
- Date: Tue, 12 Jul 2005 11:25:32 +1000
> For the record, it would look better as
>
> - (id)copyWithZone:(NSZone *)zone
> {
> LayerCell *copy = [super copyWithZone:zone]; // get superclass to
make a copy
> [copy setImage:[self image]]; // then copy
our members across
> return copy; //
before returning the copy
> }
>
> At least, thats my novice opinion.
And of course, its worth the paper its printed on because I didn't pay
attention to the memory handling inside setImage: either. But it attempted
to get across the issue about how you need to let the superclass create the
copy then you futz with it.
Sigh. Bob's right, read the Apple docs.
_______________________________________________
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