Skip navigation.
 
mlRe: NSView out of memory problem
FROM : Graham Cox
DATE : Tue Apr 01 15:17:32 2008

Are you sure? This could be just a convenient interface for creating a 
bezier object with the points passed, stroking it and releasing or 
autoreleasing it. The docs say nothing about how it's implemented.

A better idea might be to create ONE bezier object at the top of the 
loop, collect all the lines into it, then stroke it in one go after 
the loop terminates. I do this for drawing grids with many thousands 
of lines and have never hit a memory problem so far.

------
S.O.S.


On 2 Apr 2008, at 12:09 am, Jean-Daniel Dupas wrote:
> Yes, an a better way to fix it will be to use a static method:
>
> [NSBezierPath strokeLineFromPoint: linebottom  toPoint: linetop];
>
> It will avoid creation of an object for each segment.

Related mailsAuthorDate
mlNSView out of memory problem Leslie Smith Apr 1, 14:40
mlRe: NSView out of memory problem Matt Gough Apr 1, 14:50
mlRe: NSView out of memory problem Jean-Daniel Dupas Apr 1, 15:09
mlRe: NSView out of memory problem Graham Cox Apr 1, 15:17
mlRe: NSView out of memory problem Matthew Whillock Apr 1, 15:18
mlRe: NSView out of memory problem Graham Cox Apr 1, 15:36
mlRe: NSView out of memory problem Gorazd Krosl Apr 1, 15:43
mlRe: NSView out of memory problem Jean-Daniel Dupas Apr 1, 15:57
mlRe: NSView out of memory problem Matthew Whillock Apr 1, 17:23
mlRe: NSView out of memory problem Andre Schnoor Apr 1, 17:27
mlRe: NSView out of memory problem Graham Cox Apr 2, 01:05
mlRe: NSView out of memory problem Matthew Whillock Apr 2, 09:45
mlRe: NSView out of memory problem Andre Schnoor Apr 2, 10:51