From 9fcba18fa9c7342268439b43fafa149a9310a5d6 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Thu, 4 Nov 2004 10:44:28 +0000 Subject: [PATCH] gst/interfaces.override (_wrap_gst_mixer_list_tracks): Impl. Original commit message from CVS: * gst/interfaces.override (_wrap_gst_mixer_list_tracks): Impl. (_wrap_gst_tuner_list_norms, _wrap_gst_tuner_list_channels): Plug leaks. --- ChangeLog | 6 ++++++ gst/interfaces.override | 28 ++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcb7137..4c9d1d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-04 Johan Dahlin + + * gst/interfaces.override (_wrap_gst_mixer_list_tracks): Impl. + (_wrap_gst_tuner_list_norms, _wrap_gst_tuner_list_channels): Plug + leaks. + === release 0.7.93 === 2004-10-11 Johan Dahlin diff --git a/gst/interfaces.override b/gst/interfaces.override index a2cbbfd..60445a2 100644 --- a/gst/interfaces.override +++ b/gst/interfaces.override @@ -65,7 +65,9 @@ _wrap_gst_tuner_list_channels(PyGObject *self) py_list = PyList_New(0); for (l = list; l; l = l->next) { GstTunerChannel *channel = (GstTunerChannel*)l->data; - PyList_Append(py_list, pygobject_new(G_OBJECT(channel))); + PyObject *py_channel = pygobject_new(G_OBJECT(channel)); + PyList_Append(py_list, py_channel); + Py_DECREF(py_channel); } return py_list; @@ -83,7 +85,29 @@ _wrap_gst_tuner_list_norms(PyGObject *self) py_list = PyList_New(0); for (l = list; l; l = l->next) { GstTunerNorm *norm = (GstTunerNorm*)l->data; - PyList_Append(py_list, pygobject_new(G_OBJECT(norm))); + PyObject *py_norm = pygobject_new(G_OBJECT(norm)); + PyList_Append(py_list, py_norm); + Py_DECREF(py_norm); + } + + return py_list; +} +%% +override gst_mixer_list_tracks noargs +static PyObject * +_wrap_gst_mixer_list_tracks(PyGObject *self) +{ + const GList *l, *list; + PyObject *py_list; + + list = gst_mixer_list_tracks(GST_MIXER(self->obj)); + + py_list = PyList_New(0); + for (l = list; l; l = l->next) { + GstMixerTrack *track = (GstMixerTrack*)l->data; + PyObject *py_track = pygobject_new(G_OBJECT(track)); + PyList_Append(py_list, py_track); + Py_DECREF(py_track); } return py_list; -- 2.7.4