GNOME Bugzilla – Bug 566962
gnome-system monitor leaks
Last modified: 2011-11-11 10:03:55 UTC
gnome-system monitor leaks Attached is a patch to fix that. Let me know if I can commit it to trunk and/or the branch.
Created attachment 125987 [details] [review] patch to fix the issue Here is the patch that fix the issue. I was thinking of changing procman::format_size() to return a std::string but decided of the less invasive change in this patch.
Hello Hub, I see no leak in proctable.cpp because: - p is an iterator to a map<uid, char*> - this->user is a shared char* to that map's keys - when the uid is not in the map, it is duped (because getpwuid uses static memory) and inserted into the map. So maybe valgrind complains about some bits not being cleaned at exit, but i don't think there's a leak. But the other bit is totally valid. I'm going to commit it to both gnome-2-24 and trunk. Merci.
Created attachment 126001 [details] [review] new patch ok this is a rework of the patch. I actually change the UserMap value_type to std::string. This is way safer on every aspect. (I initially thought it was like that).
You probably don't want to add anything but glib.h these days since the single includes are going away.
good point. I was just following what was done elsewhere in g-s-m.
I've commited the leak plug to gnome-2-24 : http://svn.gnome.org/viewvc/gnome-system-monitor?view=revision&revision=2545 .
will attache a new version of the patch for what is left.
actually commit and pushed to master with Benoit approval.