Blimey! I went to (most) of your lectures! Networks I think it was. Software Engineerng MSc 1985/6 or thereabouts...

Anyway, have you considered using +strokeLineFromPoint:toPoint: instead? No need for an NSBezierPath instance.

Cheers,
Matt

(Ok then, some of your lectures)

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
--
Matthew Whillock
[EMAIL PROTECTED]

Mullard Space Science Laboratory
Holmbury St Mary
Surrey RH5 6NT
UK




_______________________________________________

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