On 22 Jul '08, at 6:45 PM, JArod Wen wrote:
Now I am considering the possible memory leakage in renderPath, since each time the path will be initialized and the previous one will cause memory leakage, which may be also the reason why I cannot get rid of them from the view. But if so, how about the renderPoint? It seems ok but still cannot be removed...
-renderPath does have memory leaks (unless you've turned on garbage collection) because it allocs pathPoint but never releases it. You just need to add a single [pathPoint release] at the end of that block. (Or just use [NSBezierPath bezierPathWithOvalInRect:], which is an easier way to create a circle and doesn't require you to release the result.)
As Graham pointed out, the reason your shapes don't get erased is that you don't erase them. Your -drawRect method needs to begin by clearing the passed-in NSRect to the background color, otherwise you may be leaving behind the old contents of the view.
—Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]