Re: g_get_user_config_dir leaks memory ?



On Mon, 2007-03-26 at 20:40 +0100, Rúben Fonseca wrote:
> > So my question is, is g_get_user_config_dir really leaking? Or it is
> > just a Valgrind problem? Can I make it not to leak?

Looking up entries in the password database (thats the getpwnam_r call)
can potentially take a long time (say the database stored in a LDAP
server at the other end of slow VPN link), so GLib fetches it once and
caches it.  This is why you shouldn't free it.  So yes, technically it
is leaking, but it's a one-off cost (it won't grow over time) and is
good for you.  Just ignore it: someone really should sit down and make
an officially maintained suppressions file for Valgrind for the X11 and
GLib "leaks".

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Attachment: signature.asc
Description: This is a digitally signed message part



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