Re: Workaround for framework leaks?

Christiaan Hofman <[email protected]> Mon, 16 Aug 2010 01:27:44 +0200
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Aug 16, 2010, at 1:00, Gary L. Wade wrote:

> There are indeed leaks in the frameworks. I verified at WWDC with one engineer (code was looked at) they had chosen to retain a delegate in one framework even though delegates generally do not get retained unless documented.

Can you tell where, in case I ever need it? The only cases I do know about this is in CoreAnimation, but that's partly documented (but not completely, because of undocumented stuff that happens behind the scenes, and which adds more retains that are not documented).

> Also one of the methods in the speech synthesizer returns a dictionary of properties (phonemes) you must release even though it's name suggests you must retain it yourself if you want it. Unfortunately, I can never have a clean analyzer build due to this. If you believe in your case, write a bug and possibly use an incident report for a definite solution.
> 
> - Gary L. Wade (Sent from my iPhone)

This particular framework (PDFKit) is actually full of bugs, some were confirmed by Apple engineers. Some are considerably more serious (reproducible crashers), and there I do not agree with the statement that you should only add a fix when you're sure that the bug is there. But in this case, I think it may just be better to do nothing (fixing a leak while risking a crasher is not a good idea, while fixing a crasher while risking a leak my be worthwhile).

Christiaan