GNOME Bugzilla – Bug 130816
memory leaks when rendering fonts on screen
Last modified: 2004-12-22 21:47:04 UTC
Playing half a minute with pan/zoom diagram grew dia as big as 200Mo. Most probably due to font rendering. This may help, but does not solve the leak: line 651 - lib/diagdkrenderer.c g_object_unref(G_OBJECT(rgba));
Well, actually this is most probably the leaking source (although it seems there are some more). The unref was here earlier and disappeared during rev1.13. See, http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvs/gnome&subdir=dia%2Flib&command=DIFF_FRAMESET&root=/cvs/gnome&file=diagdkrenderer.c&rev1=1.12&rev2=1.13 so this is an inline patch. (what do you use/recommand as (free) mem profiling tool ?)
just started to use valgrind and the results look quite promising. Only 'drawback' one needs to have a rather well equiped Linux/x86 machine :-) although the below does not fix all memleaks (especially not the ones which are by design ;-) the above mentioned one and some more are : 2004-01-10 Hans Breuer <hans@breuer.org> [plugging memleaks, thanks valgrind :-] * lib/dia_xml.c (data_string) : don't leak return value of xmlNodeListGetString() * lib/dia_xml.c (xml_file_check_encoding) : g_free(buf) before returning, maybe alloca() would be the better choice but anyway ;) * objects/custom/custom_object.c:306 : adde xmlFree(str) below * lib/font.c (dia_font_build_layout) : don't leak result of g_utf8_strdown() * lib/diagdkrenderer.c (draw_string) : don't leak rgba (this is the one which got me started using valgrind, see #130816)
Oh, just noticed how specific the subject was, now this is fixed above :-)