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 620898 - Don't free transfer full struct pointers because we can't do it safely
Don't free transfer full struct pointers because we can't do it safely
Status: RESOLVED FIXED
Product: pygi
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: 0.6
Assigned To: pygi-maint
pygi-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-07 20:37 UTC by johnp
Modified: 2010-06-15 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't free transfer full struct pointers because we can't do it safely (3.12 KB, patch)
2010-06-07 20:37 UTC, johnp
committed Details | Review

Description johnp 2010-06-07 20:37:53 UTC
* Most libraries which are sending back structs as transfer-full
  are either annotated incorrectly or should be sending boxed types
* It is much better to throw a warning and leak memory than it is to
  call free on an unknown struct pointer.  Doing so may cause
  a double free
* Specific case is gdk_atom_intern where a GdkAtom is not actually a pointer
  but an integer stuffed into a pointer type
Comment 1 johnp 2010-06-07 20:37:54 UTC
Created attachment 162971 [details] [review]
Don't free transfer full struct pointers because we can't do it safely
Comment 2 Tomeu Vizoso 2010-06-15 10:17:12 UTC
Review of attachment 162971 [details] [review]:

We can actually free those when they are foreign because we have an appropriate release function, but this can go in a future patch.
Comment 3 Tomeu Vizoso 2010-06-15 10:17:31 UTC
Attachment 162971 [details] pushed as 606018a - Don't free transfer full struct pointers because we can't do it safely