Hello again,
> I've used VS2003 to compile this example, and when the "cache" option is
> open,
> the App would crash when execute to "FT_Done_Face( face );". and I can
> see clearly that after "FTC_Manager_Done( cache_man )", the face's memory
> have
> been throughly destroyed!
>
>
you're absolutely right !! I had not noticed that the face requester in
ftbench didn't create a new FT_Face object, but simply returned the
global one.
In this case, FTC_Manager_Done does destroy the face, and the second
call to FT_Done_Face is redundant and/or corrupts memory.
I've fixed this in the CVS with the following:
---------------------------------------------------------------------
/* the following is a bit subtle: when we call FTC_Manager_Done,
* this normally destroys all FT_Face objects that the cache might
* have created by calling the face requester.
*
* however, this little benchmark as a tricky face requester that
* doesn't create a new FT_Face through FT_New_Face, but simply
* pass a pointer to the one that was previously created.
*
* if the cache manager was used before, the call to FTC_Manager_Done
* will discard our single FT_Face.
*
* in the case where no cache manager is in place, or if no test
* was run, the call to FT_Done_FreeType will release any remaining
* FT_Face anyway
*/
if ( cache_man )
FTC_Manager_Done( cache_man );
FT_Done_FreeType( lib );
------------------------------------------------------------------------
thanks a lot,
- David Turner
- The FreeType Project (www.freetype.org)
>
>
>
>
> _______________________________________________
> Freetype mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/freetype
>
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype