Re: NSImage leaks on every draw?! Help!
Re: NSImage leaks on every draw?! Help!
- Subject: Re: NSImage leaks on every draw?! Help!
- From: "Ben Kennedy" <email@hidden>
- Date: Thu, 24 Oct 2002 16:38:32 -0400
- Organization: Zygoat Creative Technical Services
On 24,10,02 at 3:50 pm -0400, Ben Kennedy wrote:
>
Now, you're going to wonder where the image comes from in the first
>
place. It's stored in my document as an archived object, brought to life
>
in initWithCoder:, and initially supplied by the user from any source
>
(PDF, GIF, etc).
>
>
Interestingly, the leaks do not occur if I hard-code a particular pre-
>
existing image with a line such as img = [NSImage imageNamed:@"foo"].
>
They do under normal use though, where the NSImage comes from the
>
unarchived document.
Follow-up:
If I call [img setDataRetained:NO] after un-archiving the image, the
leaks stop (however, the image when subsequently composited and scaled
looks like crap).
In my test case, img typically begins life as a PDF, so my inference is
that when its data are retained it is being re-composited EVERY time it
is asked to draw, allocating more memory each time and never releasing
it. If this is the case, why? First, there's no reason it should be
repeatedly re-composited, but even if that's what's happening, why is it
leaking memory each time?
-b
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.