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 596739 - Python bindings leak memory
Python bindings leak memory
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-29 13:26 UTC by Benjamin Berg
Modified: 2009-10-05 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that should fix some leaks (3.48 KB, patch)
2009-09-29 14:07 UTC, Benjamin Berg
none Details | Review

Description Benjamin Berg 2009-09-29 13:26:39 UTC
The python bindings leak at least the return value of vte_terminal_get_text and similar functions. The return value of these is owned by the caller, but in the overriden functions (and the def file, not that that matters) they are not correctly freed. A gchar* passed to Py_BuildValue needs to be freed by the binding, as python just creates a copy itself.
Comment 1 Benjamin Berg 2009-09-29 14:07:34 UTC
Created attachment 144269 [details] [review]
patch that should fix some leaks

Warning: I have not even tried to compile this!
Comment 2 Behdad Esfahbod 2009-09-29 15:36:49 UTC
Hi Benjamin,

I don't know much about the python bindings.  If you can review it yourself again for obvious omissions, etc, feel free to commit.

Thanks
Comment 3 Benjamin Berg 2009-10-05 15:47:10 UTC
OK, I have looked more closely, found more leaks and fixed those too (attribute list). I think the patch is good, and I have pushed it to master.

commit fa3508f4957a8cfb6f6f22ef904d5c89f9d54f4a
Author: Benjamin Berg <benjamin@sipsolutions.net>
Date:   Mon Oct 5 17:41:49 2009 +0200

    Fix memory leaks in python bindings (bug #596739).

http://git.gnome.org/cgit/vte/commit/?id=fa3508f4957a8cfb6f6f22ef904d5c89f9d54f4a