autoreleasing NSBezierPath object
autoreleasing NSBezierPath object
- Subject: autoreleasing NSBezierPath object
- From: Oscar Bascara <email@hidden>
- Date: Tue, 26 Jun 2001 20:38:43 -0700
Here's a newbie question.
In Learning Cocoa, the Dot View project calls the following line in the
drawRect: method:
[[NSBezierPath bezierPathWithOvalInRect:dotRect] fill];
Does the NSBezierPath object that gets created (allocated and
initialized) need to be autoreleased?
[[[NSBezierPath bezierPathWithOvalInRect:dotRect] autorelease] fill];
The object is never explicitly released/autoreleased in the program.
Since drawRect: can be called many times, I'm just concerned about a
possible memory leak.
Or is it that the NSBezierPath object is autoreleased by default, and if
you really want it, you need to retain it?
Oscar