Hi:

I have a Cocoa application which draws a (very) large number of line segments using the code below in a loop, in drawRect, in a subclass of NSView.

p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom]  ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;

(These are the outputs from a neural network simulator.) I'm just using one NSView: if I draw a set of outputs, and then (later) draw another set of outputs (filling the rect with white in between), I eventually run out of memory. Clearly, I need to free up something but I really do not know what. (Well, I should probably create a new NSView each time, but I'd like a quicker fix.)

I tried [p1 release] ; after the code above, but that simply made the app crash.

I can't seem to find anywhere that tells me how to do this: it looks as though once I have drawn something in an NSView, using NSBezierPath, the memory used stays used. I'm sure I'm missing something.

--Leslie Smith


Professor Leslie S. Smith,
Dept of Computing Science and Mathematics,
University of Stirling,
Stirling FK9 4LA, Scotland
[EMAIL PROTECTED]
Tel (44) 1786 467435 Fax (44) 1786 464551
www http://www.cs.stir.ac.uk/~lss/
UKRI IEEE NNS Chapter Chair: http://www.cs.stir.ac.uk/ieee-nns-ukri/




--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.


_______________________________________________

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]

Reply via email to