I tried this, but it crashes,
How does it crash? Is this on the T5 simulator?
and the manual says:
""Palm OS 4.0 and later do not allow a NULL value for the fontP parameter....""
That's because of a bug in FntDefineFont, which was introduced in Palm OS 5.0, and fixed in Palm OS 5.3 (or maybe earlier...the bug fix was made on 1/15/03).
So you should be able to safely call it when running with Palm OS 5.4/T5. I took at look at the source, and didn't see any obvious problems. I'll need to check if palmOne is patching this routine for some reason, as that could be where it's crashing.
-- Ken
----- Original Message ----- From: "Ken Krugler" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Friday, November 05, 2004 9:46 AM Subject: Re: T5 memory leak in FntDefineFont
any>Has anyone found a work around for this memory leak ? > >In the T5 simulator and the actual unit, the function: >void FntDefineFont(fontID id, FontTag *pTag) >appears to have a memory leak, about 80% of the size of the >font being passed in, who should I report this to ? I'm not aware of> -- Ken>API to >recover this, it is not a leak in any other OS 3.0, 4.0 or 5.0 units or >emulators/simulators.
What happens if you call FntDefineFont(id, NULL) to clear out the font? I know that PACE used to have some code to release the shadow of the font when you did this.
One warning is that passing NULL would trigger an error (and potentially give you invalid results) on Palm OS 4.0, 4.1, and perhaps early 5.x releases.
-- Ken Krugler TransPac Software, Inc. <http://www.transpac.com> +1 530-470-9200
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
