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 623969 - make sure caller allocated structs are freed when they go out of scope
make sure caller allocated structs are freed when they go out of scope
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-09 17:23 UTC by johnp
Modified: 2012-04-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make sure caller allocated structs are freed when they go out of scope (6.33 KB, patch)
2010-07-09 17:23 UTC, johnp
committed Details | Review

Description johnp 2010-07-09 17:23:41 UTC
* Move struct transfer checks from pygi-arguments to pygi-invoke
* add better warning if an unknown struct is fully transfered
* only free GValues we create in the invoke cleanup.  All other structs
  get cleaned up when they go out of scope in python
* Fixes issues with caller allocated treeiters getting freed to early
* this is a fix to crashes in the current test suite when API's returning
  TreeIters were annotated as out caller-allocates so no new tests
  are needed
Comment 1 johnp 2010-07-09 17:23:43 UTC
Created attachment 165568 [details] [review]
make sure caller allocated structs are freed when they go out of scope
Comment 2 Tomeu Vizoso 2010-07-30 09:17:40 UTC
Attachment 165568 [details] pushed as c9da578 - make sure caller allocated structs are freed when they go out of scope
Comment 3 Simon van der Linden 2010-07-30 09:48:37 UTC
This patch has broken the following test:

test_tree_api (test_overrides.TestGtk) ... python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed.
Comment 4 Martin Pitt 2012-04-04 16:09:21 UTC
The patch was committed long ago, and the tests work, so I think this can be closed.