Re: Valgrind says gtkmm is leaking



On Mon, 7 Jun 2010 00:06:12 +0200
Ondřej Pelech <ondra pelech gmail com> wrote:

> Hello,
> 
> I'm writing a simple gtkmm application as a school project. I
> valgrinded it to see that it's leaking.
> 
> After few testings I also realized, that even the simplest examples
> (from here: [0], [1], [2]) are leaking too.
> 
> I've packed 3 of the examples along with the valgrind outputs as an
> attachment: gtkmm.leaking.examples.tar.gz
> 
> I'm using up-to-date Ubuntu 9.10, package libgtkmm-2.4-1c2a in version
> 1:2.18.2-1, package libglibmm-2.4-1c2a in version 2.22.1-2, package
> valgrind in version 1:3.5.0-2ubuntu2.
> 
> This is quite bad for me, because I don't know, whether my project
> will be accepted when it' leaking.
> What's going wrong? Can I prevent this somehow?

I haven't looked at all your examples but I suspect your code is OK and
there aren't any leaks.  What you are most likely seeing is the effect
of single instance library allocations (which are usually not
deallocated because there is no reason to do so) and of glib memory
slices.

This could usefully form the start of a suppressions file.  See the
valgrind documentation for further information.  However to get
meaningful results you need to run your test program with the
environmental variable G_SLICE set to always-malloc.

Chris


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