• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
autoreleasing NSBezierPath object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: autoreleasing NSBezierPath object
      • From: Brendan Younger <email@hidden>
    • Re: autoreleasing NSBezierPath object
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Cocoa Java NSString drawing?
  • Next by Date: Re: warning: xxx.app depends on itself
  • Previous by thread: Cocoa Java NSString drawing?
  • Next by thread: Re: autoreleasing NSBezierPath object
  • Index(es):
    • Date
    • Thread