NSImage leaks Help!
NSImage leaks Help!
- Subject: NSImage leaks Help!
- From: Steve Gehrman <email@hidden>
- Date: Fri, 16 Nov 2001 19:39:30 -0800
I've found memory leaks using NSImage. Does anyone know what I can do
to get around this? I'm loading an image, which could be a jpg or a pdf
or whatever, and calling lockFocus, unlockFocus to create a cached
image. I'm doing this so when when I go to draw it, it will draw
quickly. The problem is when I delete the image, the cached stuff is
not being released.
When run with MallocDebug, this code shows a bunch of things leaking.
Anyone know how to get around this?
NSImage* image = [[NSImage alloc]
initWithContentsOfFile:@"/Users/sgehrman/fuck.jpg"];
[image lockFocus];
[image unlockFocus];
[image release];
--
Steve Gehrman
CocoaTech, Inc.
email@hidden
http://www.cocoatech.com