memory leak in GObject?
Hello, I have discovered a momory leak in GObject.
Even with the GLib supression definition for Valgrind, I get this momery leak:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 --suppressions=/usr/share/glib-2.0/valgrind/glib.supp --log-file=vgdump <executable>
I also tried to run the following line, but with the exact same result:
G_SLICE=always-malloc G_DEBUG=resident-modules valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 --suppressions=/usr/share/glib-2.0/valgrind/glib.supp --log-file=vgdump <executable>
I have traced it to g_object_constructor ()
, which is the place where g_type_create_instance ()
is run, but it is never freed, as the code to do that is in a very odd place.
I can't see when it would ever be run, as it is inside the if-statement on line 3498.
I noticed it in my code as I where my constructor chains up to the base class constructor, and I got the leak in the same place even if I did not not have anything (but the chain) in the constructor.
My finalizes are also chained up in proper order, so it is not that either.
Or am I just missing something? Is Valgrind being overly picky (It says it is definitely lost)?
Most sincerest apologies if I'm wrong,
and best regards,
// Gustav Hartvigsson.