diff --git a/ChangeLog b/ChangeLog index 6d717e57c7..502dc09330 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-07-13 Edward Hervey <edward@fluendo.com> + + * gst/gstbus.override: (bus_handler) (bus_sync_handler): + Raise an exception if the callback doesn't return anything + + * gst/pygstminiobject.c: + removed the 'ref' and 'unref' methods + 2005-07-13 Andy Wingo <wingo@pobox.com> * examples/pipeline-tester: Tweaks, show messages. diff --git a/gst/gstbus.override b/gst/gstbus.override index f8aeb87854..e0178ca3a7 100644 --- a/gst/gstbus.override +++ b/gst/gstbus.override @@ -55,7 +55,11 @@ bus_sync_handler (GstBus *bus, GstMessage *message, gpointer user_data) PyErr_Print(); res = GST_BUS_PASS; } else { - if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res)) + if (ret == Py_None) { + PyErr_SetString(PyExc_TypeError, "callback should return a BusSyncReply"); + PyErr_Print(); + res = GST_BUS_PASS; + } else if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res)) res = GST_BUS_PASS; Py_DECREF (ret); } @@ -101,7 +105,12 @@ bus_handler (GstBus *bus, GstMessage *message, gpointer user_data) PyErr_Print(); res = TRUE; } else { - res = PyObject_IsTrue(ret); + if (ret == Py_None) { + PyErr_SetString(PyExc_TypeError, "callback should return True or False"); + PyErr_Print(); + res = TRUE; + } else + res = PyObject_IsTrue(ret); Py_DECREF(ret); } Py_DECREF(args); diff --git a/gst/pygstminiobject.c b/gst/pygstminiobject.c index 0bcece70d6..15c5433ee3 100644 --- a/gst/pygstminiobject.c +++ b/gst/pygstminiobject.c @@ -405,27 +405,10 @@ pygstminiobject_copy(PyGstMiniObject *self, PyObject *args) return pygstminiobject_new(gst_mini_object_copy(self->obj)); } -static PyObject * -pygstminiobject_ref(PyGstMiniObject *self, PyObject *args) -{ - gst_mini_object_ref(self->obj); - return (PyObject*) self; -} - -static PyObject * -pygstminiobject_unref(PyGstMiniObject *self, PyObject *args) -{ - gst_mini_object_ref(self->obj); - Py_INCREF(Py_None); - return Py_None; -} - static PyMethodDef pygstminiobject_methods[] = { { "__gstminiobject_init__", (PyCFunction)pygstminiobject__gstminiobject_init__, METH_VARARGS|METH_KEYWORDS }, { "copy", (PyCFunction)pygstminiobject_copy, METH_VARARGS, "Copies the miniobject"}, - { "ref", (PyCFunction)pygstminiobject_ref, METH_VARARGS, "Adds a reference to the miniobject" }, - { "unref", (PyCFunction)pygstminiobject_unref, METH_VARARGS, "Removes a reference from the miniobject"}, { NULL, NULL, 0 } };