Pango loads a font over and over again. (Major leak)


I'm using pango to render an image of a text (of default gtk font) via
freetype part of pango. I believe that I have manage to hit
a major memory leak in pango. For some reason the default TTF font gets
loaded over and over again.
(Look in /proc/<pid>/maps)

I have attached a small example that rapidly consumes more and more
memory. I have really tried to see if I have failed to dealloc
something, but I have not been able to find something. Please correct me
if I'm all wrong!

This behaviour has been verified on several distributions (Feodora &
Slackware atleast)

Relevant library versions (on my slackware installation):

 GTK+ 2.4.9
 Glib 2.4.6
 gcc v3.3.3

Please contact me if some more information is needed or if
I shall preform some tests/upgrades. 

Thanks alot!

To compile and run the example:

gcc `pkg-config gtk+-2.0 pango pangoft2 --cflags --libs` pango_test.c -o
pango_ test

cat /proc/`/sbin/pidof pango_test`/maps |grep "ttf" |wc -l

Attachment: pango_test.c
Description: Binary data

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