diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-11-23 12:42:33 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-11-23 12:42:33 +0000 |
commit | 0c6187cffcfe4d2d9e05857914d2b0b11933282f (patch) | |
tree | 636644ec2a0b940ead84a6236aacee4331c187ea | |
parent | 71a33c7ef725409b6bc6dd7c08e0ba8aecbe8861 (diff) | |
download | pygobject-0c6187cffcfe4d2d9e05857914d2b0b11933282f.tar.gz pygobject-0c6187cffcfe4d2d9e05857914d2b0b11933282f.tar.xz pygobject-0c6187cffcfe4d2d9e05857914d2b0b11933282f.zip |
Make sure type is a type and sinkfunc isn't NULL.
* gobject/pygobject.c (pygobject_register_sinkfunc): Make sure
type is a type and sinkfunc isn't NULL.
-rw-r--r-- | gobject/pygobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c index af6f3be..eb3e991 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -72,6 +72,9 @@ pygobject_register_sinkfunc(GType type, void (* sinkfunc)(GObject *object)) { SinkFunc sf; + g_return_if_fail(G_IS_TYPE(type)); + g_return_if_fail(sinkfunc != NULL); + if (!sink_funcs) sink_funcs = g_array_new(FALSE, FALSE, sizeof(SinkFunc)); @@ -342,7 +345,7 @@ pygobject_new(GObject *obj) Py_INCREF(Py_None); return Py_None; } - + /* we already have a wrapper for this object -- return it. */ self = (PyGObject *)g_object_get_qdata(obj, pygobject_wrapper_key); if (self != NULL) { |