> On 29 Jan 2015, at 3:05 pm, N!K <pu56ucl...@alumni.purdue.edu> wrote:
> 
> NSBezierPath* temp;    is in the list of declarations.
> This snippet is in drawRect:
> 
>        NSAffineTransform* tfm = [[NSAffineTransform alloc] init];
>        [tfm scaleXBy:scaleX yBy:scaleY];
>       temp  = [tfm transformBezierPath:_path];
>       NSLog(@“\n\n temp = %p\n\n",temp);
> 
> 
> I hope ARC keeps cleaning them up. Or do I have a memory leak? If so, I’d 
> appreciate some guidance on how to fix it.


You're fine leaks-wise, but your code might be cleaner. The bezier path 
returned by [tfm transformBezierPath] is autoreleased. ARC cleans up tfm, temp 
is released at the end of the event cycle. If temp is an ivar, and it's not 
used anywhere else, just make it a local var (it will be stale after the event 
cycle completes anyway). If it's an ivar and it is referenced elsewhere, you 
probably should make it a strong property instead.

--Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to