Re: Memory leaks in using g_ptr_array_free() of GLib?




First of all, sorry if this is not the adecuate list to ask about
GLib, but I haven't found the list about GLib.

Yes, this is the proper list also for GLib related questions.

valgrind --leak-check=full ./memptr


In order to have some proper results with Valgrind, you always need to tell GLib not to use the slice-allocator implementation, and use standard g_malloc/g_free instead. You can do this setting G_SLICE to 'always-malloc' before calling your program:
$> export G_SLICE=always-malloc
$> valgrind --leak-check=full ./memptr

http://library.gnome.org/devel/glib/stable/glib-running.html
http://live.gnome.org/Valgrind

Cheers,
-Aleksander




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