freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leaks?


From: David Turner
Subject: Re: Memory leaks?
Date: Wed, 28 Jun 2000 18:49:36 +0200

Hi Elliot,

> 
> On Fri, 23 Jun 2000, David Turner wrote:
> 
> > >memprof (http://people.redhat.com/otaylor/memprof/) complains about a
> > >bunch of leaks in freetype, and from a quick look at one of the most
> > >common ones (FT_Get_Glyph_Bitmap - there's no standard way of freeing the
> > >the bitmap buffer that it allocates) it seems like it's not just my
> > >imagination.
> > >
> > >Known problem, or are there some destructors that I should be calling and
> > >might be missing?
> >
> > What about FT_Done_Glyph ?? (also defined in <freetype/ftglyph.h>)
> > It's supposed to destroy the bitmap buffer..
> 
> FT_Done_Glyph destroys an FT_Glyph. It doesn't do cleanup for the
> FT_GlyphSlot contained in an FT_Face.
> 

Well, that's normal behaviour.. The glyph slot is "owned" by the face object
and is destroyed with it in FT_Done_Face.

On each call to FT_Load_Glyph, the glyph image in the slot is erased with
a new one..

The FT_Glyph is used to "extract" one glyph image (bitmap or outline). It
can be used even when the slot has been destroyed. On the other hand, you
need to destroy it explicitely..

Hope this clarifies !

By the way, I've tried to use memprof on my Linux box (Mandrake 6.1) and
couldn't have it compile correctly.

I compiled and installed libglade-0.13 before (I have Gnome >= 1.2 + all
other deps)

Then compiled memprof 0.3.0 (from Owen's site) with no success..

Apparently, the Makefile misses "-lglade -lglade-gnome". Even with
these, memprof compiles but fails to run with a "unable to open
shared library libglade.so.0" (which is installed correctly on
the system though..)..

Is there another way, or a more recent version available somewhere ??
Couldn't it be used in text mode only (I suppose it would prove a lot
more easy to install too :-)

I'd really like to try it.. By the way, the latest snapshot doesn't
report memory leaks with "freetype2/demos/memtest.c", I'd really like
to know what "memprof" tells you ??

Thanks,

- David


> -- Elliot
> The best way to accelerate a Macintosh is at 9.8 meters per second per second.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]