Re: retain, copy, release, autorelease...leak
Re: retain, copy, release, autorelease...leak
- Subject: Re: retain, copy, release, autorelease...leak
- From: email@hidden
- Date: Thu, 28 Jun 2001 16:55:20 -0400
*correction*
forgive the second half of my last post, as I didn't think to read the
ENTIRE message.
I can at least tell you why you're getting memory leaks: your
colorStore = [self Quickly] method should be OUTside your for loop. You
are creating 10000 functionally identical but different objects and
adding each to the array. You should create one, and add it to the array
10000 times.
You are probably crashing because you shouldn't call release or
autorelease on an already autoreleased object, since they get 'released'
when your function returns.
-- Robert Lee Dotson
"Very funny, Scotty. Now beam up my clothes."