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 482795 - memory leak in Gtk2::Pango::Layout::get_iter
memory leak in Gtk2::Pango::Layout::get_iter
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2007-10-03 01:07 UTC by Quentin Sculo
Modified: 2007-10-03 17:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
test-case program (268 bytes, text/plain)
2007-10-03 01:16 UTC, Quentin Sculo
  Details
Plug the leak (558 bytes, patch)
2007-10-03 17:28 UTC, Torsten Schoenfeld
committed Details | Review

Description Quentin Sculo 2007-10-03 01:07:30 UTC
Please describe the problem:
Calling $layout->get_iter; leaks memory
I'm using it to get the y position of the first line ($layout->get_iter->get_baseline) so I can align the layout with other things.
Any work-around would be very appreciated.

Steps to reproduce:
By running the attached test program

Actual results:
memory usage grows

Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Quentin Sculo 2007-10-03 01:16:55 UTC
Created attachment 96547 [details]
test-case program

Running this simple program makes memory usage (as seen by top) grows _very_ rapidly (about 5m per second on my system). Be sure to terminate it with ctrl-C.
One strange thing I just noticed is that changing the timeout value from 1 to 2 or more, _greatly_ slows the growing of memory usage, I've got no idea why.
Comment 2 Torsten Schoenfeld 2007-10-03 17:28:14 UTC
Created attachment 96577 [details] [review]
Plug the leak

Yep, that's a bindings bug.  Fixed in CVS.

I don't know how you'd work around this leak in Perl, unfortunately.