Re: Leak when animating Core Animation Superlayer
Re: Leak when animating Core Animation Superlayer
- Subject: Re: Leak when animating Core Animation Superlayer
- From: "Stéphane Droux" <email@hidden>
- Date: Sun, 1 Jun 2008 14:55:06 +0100
On Sun, Jun 1, 2008 at 1:15 PM, Gustavo Eulalio <email@hidden> wrote:
> Well, I'm novice to Cocoa/ObjC programming, so, I might be wrong. But
> I see you're setting a new frame on l2 every time fromTimer: is
> called, but you never release the old one. The following may solve it,
> if that's the problem.
>
> - (void) fromTimer: (NSTimer *) t
> {
> [l2.frame release]
> l2.frame = CGRectMake((double)random() / RAND_MAX*30, (double)random()
> /
> RAND_MAX*30, (double)random() / RAND_MAX*40, (double)random() /
> RAND_MAX*40);
> l1.opacity = (double)random() / RAND_MAX;
> }
>
> Or are you using the garbage collector?
> By the way, shouldn't this be done via an accessor method? [l2
> setFrame:...]
>
>
frame is a CGRect readwrite property. It can be changed via l2.frame and
doesn't need any retain/release
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden