[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] A possible fix for potential memory leak in FT_GlyphSlot_
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] A possible fix for potential memory leak in FT_GlyphSlot_Own_Bitmap and some other questions about FT_GlyphSlot_Embolden() |
Date: |
Wed, 17 Dec 2008 12:03:18 +0100 (CET) |
> In freetype 2.3.7, FT_GlyphSlot_Own_Bitmap does not release the old
> bitmap resource. Then I give a possible patch for it.
I don't think this patch is correct. If you run `ftview' (which uses
this function if you press key `2') with valgrind, you can see that
all allocated memory is properly freed.
> And I have some other questions about FT_GlyphSlot_Embolden(),
>
> In include/freetype/ftsynth.h
> /* Do not use this function directly! Copy the code to */
> /* your application and modify it to suit your need. */
This comment is still true -- there is no parameterization of the
boldness factor.
> FT_EXPORT( void )
> FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
>
> And in FT_GlyphSlot_Embolden, it calls FT_GlyphSlot_Own_Bitmap, but
> there are some internal calls in FT_GlyphSlot_Own_Bitmap, such as
> FT_SLOT_FACE and FT_PIX_FLOOR(they marcos).
I've moved FT_GlyphSlot_Own_Bitmap to a ftbitmap.h to make it
`official'; I've also replaced the two internal macros with real code.
> I just want to make sure whether now FT_GlyphSlot_Embolden() is
> stable enough or not. Is seemed many toolkits for CJK fonts depend
> on this API.
It's stable but not part of the `official' FreeType API. Copy and
paste is the right way.
Werner