Re: newbie EXC_BAD_ACCESS
Re: newbie EXC_BAD_ACCESS
- Subject: Re: newbie EXC_BAD_ACCESS
- From: Charilaos Skiadas <email@hidden>
- Date: Mon, 21 Mar 2005 21:03:21 -0600
On Mar 21, 2005, at 8:48 PM, Hamish Allan wrote:
On Mar 22, 2005, at 1:02, Charilaos Skiadas wrote:
I would think that [self addStrokeDesc: sd] would presumably add sd
to some array where all those stroke descriptions are kept, hence sd
would be retained there, hence can safely be released here, since
this is the last line in the code anyway, and this method does not
return sd anyway.
True, but I was also trying to imagine why he was getting the
behaviour he described when he said "the knownStrokes array was
getting the last copy of sd created placed in every single slot of the
array." If he wasn't retaining sd in addStrokeDesc: then he would get
that behaviour with release but not with autorelease (because the next
allocated StrokeDescription would have the same pointer as the
previous one). I wanted him to try to explain why, so I didn't go
further into it. As it turns out, he is retaining sd in addStrokeDesc:
so my assumption was incorrect (sorry!)
Fair point. It's not clear from the code that that's what's happening
in addStrokeDesc.
Haris
_______________________________________________
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