Re: Memory leak when using Gio::File



On Thu, 23 Aug 2012 11:25:44 +0600
Galymzhan <kozhayev gmail com> wrote:
> Using Gio::init() instead of g_type_init() does not make a difference.
> There is still a leak:
> 
> 
> ==2885== LEAK SUMMARY:
> ==2885==    definitely lost: 40 bytes in 1 blocks
> ==2885==    indirectly lost: 120 bytes in 10 blocks
> ==2885==      possibly lost: 13,975 bytes in 258 blocks
> ==2885==    still reachable: 79,346 bytes in 1,424 blocks
> ==2885==         suppressed: 0 bytes in 0 blocks
> 
> 
> Here is a full valgrind summary: https://gist.github.com/3432925
> Also, I tried to reset RefPtr's pointer with `file.reset();` but that
> does not help. Is there any method of Gio::File which is supposed to
> do closing or cleanup?

It almost certainly isn't a leak.  For a start, it doesn't look from
your earlier posting that you turned off memory slices (which uses
caching) by forcing use of malloc or followed the other advice on using
valgrind with gobject/gtk+. Even if you did, glib doesn't free one time
allocations made on type initialisation when exiting, for efficiency
reasons.

The gnome webpage on using gtk+ with valgrind also has some links to
suppressions files which may or may not be suitable for your purposes.

Or you could use your example as the beginnings of your own suppression
generator.

Chris


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