Re: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
Re: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
- Subject: Re: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
- From: Ricky Sharp <email@hidden>
- Date: Thu, 6 Apr 2006 18:45:12 -0500
On Apr 5, 2006, at 6:26 PM, Ricky Sharp wrote:
As my app nears alpha, I'm now using MallocDebug to ensure it's
free of leaks. Only one type of leak remains which has me puzzled.
Each individual leak is always for 100 bytes and it seems to only
occur sometimes when I call drawInRect:fromRect:operation:fraction:
against an instance of NSImage.
Just some more info in case others see this.
I was able to reproduce this in a tiny test app with NSImageView. It
does appear though that the leaks are caused by low-level CG/PDF APIs
and so any future communication on my part will be directed to quartz-
dev. I'll be able to file a bug on this soon.
Thankfully, my app uses an "image factory" that keeps instances of
NSImage objects alive during the app's lifetime. And, it appears the
leak only occurs when the original PDF data is rendered into an image
representation. As building of these reps only occur once per image,
even if my app eventually loads/draws every PDF image, it will only
be leaking about 10K or so. If an app were to purge and re-create
PDF reps over time, I could see this leak potentially causing a major
problem.
Finally, I don't really have an exact cause of the leak, but it
appears to be tied to transparency effects. Strangely, not all PDFs
that have such effects cause a leak. I was also able, in some cases,
to get more/less bytes leaked as I adjusted shadow blur values.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden