After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628564 - list_properties() memory leak if no properties
list_properties() memory leak if no properties
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-09-01 22:45 UTC by Kevin Ryde
Modified: 2010-10-30 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
failing program, on an object (188 bytes, text/x-perl)
2010-09-01 22:45 UTC, Kevin Ryde
  Details
failing program, on an interface (258 bytes, text/x-perl)
2010-09-01 22:45 UTC, Kevin Ryde
  Details
patch (1.13 KB, patch)
2010-09-01 22:49 UTC, Kevin Ryde
committed Details | Review

Description Kevin Ryde 2010-09-01 22:45:12 UTC
Created attachment 169304 [details]
failing program, on an object

Glib::Object->list_properties() and similar calls on objects or interfaces with no properties leaks memory.  The programs obj.pl and iface.pl below use ever more memory.

I think the g_free() must be done always, even when n_props==0, per attached diff.  I think the returned pspecs array is never empty but always has at least a NULL sentinel.  Alas like many details that's not actually described in the glib docs.
Comment 1 Kevin Ryde 2010-09-01 22:45:55 UTC
Created attachment 169305 [details]
failing program, on an interface
Comment 2 Kevin Ryde 2010-09-01 22:49:09 UTC
Created attachment 169306 [details] [review]
patch
Comment 3 Torsten Schoenfeld 2010-10-30 22:49:39 UTC
Reading the gobject code confirms your conclusions.  Committed.  Thanks.