[ gpsdrive ] bug [ 2124271 ] gpsdrive leaks memory at 7mb/hr

Hamish hamish_b at yahoo.com
Sat Sep 27 22:57:32 AKDT 2008


[cc'd from the bug report]
  http://sourceforge.net/tracker/?group_id=148048


I just fixed a few minor memory leaks with r2078, mostly wtr
PangoFontDescription.


The biggest leaks are still out there.

Figuring the only thing that could leak 1.75kb/sec was graphics or glyphs,
I was trying to follow GdkPixBuf* allocations. (*icon seems to come up in
valgrind reports..?)

Do those each need gdk_pixbuf_unref() to free? I am not sure, but it's
the closest name to "gdk_pixbuf_free()" that I could find.
(I have very little GTK experience)

I notice that while gdk_pixbuf_unref() is used in some parts of the code
it is behind "#ifndef GDK_PIXBUF_DISABLE_DEPRECATED" in the header file,
so apparently not something to start adding into the code as new..   ??


"g_free(tempimage)" seems to be wrong. It is only allocated once AFAICT
and so not actually progressively leaking after the initial allocation. I
think freeing it at the end of expose_cb() is wrong as it gets reused the
next time the fn runs. Putting g_free(tempimage) at the end of main()
causes valgrind to complain about an invalid free, and doesn't help the
final abandonment score any.


Hamish


More information about the GPSdrive mailing list