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 618572 - Convert None to NULL for interfaces which take object pointers
Convert None to NULL for interfaces which take object pointers
Status: RESOLVED DUPLICATE of bug 617880
Product: pygi
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: 0.6
Assigned To: pygi-maint
pygi-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-13 21:02 UTC by johnp
Modified: 2010-05-14 15:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] if None is passed to an interface which takes an object, convert it to NULL (642 bytes, patch)
2010-05-13 21:03 UTC, johnp
reviewed Details | Review

Description johnp 2010-05-13 21:02:59 UTC
I wrote a function in Gtk that could take a GtkRadioAction * or a NULL.  Sending None would not get converted to a NULL and would instead send a garbage pointer 0x3.  This patch checks for None in the code path and sets the arg to NULL.
Comment 1 johnp 2010-05-13 21:03:25 UTC
Created attachment 161007 [details] [review]
[PATCH] if None is passed to an interface which takes an object, convert it to NULL

 gi/pygi-argument.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Comment 2 johnp 2010-05-13 21:06:04 UTC
How should we test this without GTK? Should I add a test object to gobject-introspection?
Comment 3 Johan (not receiving bugmail) Dahlin 2010-05-13 21:06:51 UTC
Review of attachment 161007 [details] [review]:

Looks good. Misses a test although.
Comment 4 Tomeu Vizoso 2010-05-14 07:43:05 UTC
There's a test in the same patch at https://bugzilla.gnome.org/show_bug.cgi?id=617880 . I'm sorry but I haven't gotten the chance to think a better commit message and push it.
Comment 5 johnp 2010-05-14 15:24:19 UTC

*** This bug has been marked as a duplicate of bug 617880 ***