memleak fixes. Thanks valgrind :)

Original commit message from CVS:
* gst/gstpad.override:
* gst/gststructure.override:
* testsuite/testhelpermodule.c: (_wrap_emit_event):
memleak fixes. Thanks valgrind :)
This commit is contained in:
Edward Hervey 2005-10-06 16:58:38 +00:00
parent e8319d9581
commit 396316a7e4
4 changed files with 25 additions and 19 deletions

View file

@ -1,3 +1,10 @@
2005-10-06 Edward Hervey <edward@fluendo.com>
* gst/gstpad.override:
* gst/gststructure.override:
* testsuite/testhelpermodule.c: (_wrap_emit_event):
memleak fixes. Thanks valgrind :)
2005-10-06 Edward Hervey <edward@fluendo.com>
* gst-python.spec.in:

View file

@ -392,17 +392,27 @@ _wrap_gst_pad_tp_repr (PyGObject *self)
{
char *buf;
PyObject *retval;
GstPad *pad;
GstElement *parent;
GstPad *pad;
GstElement *parent;
gchar *padname = NULL;
gchar *elementname = NULL;
pad = GST_PAD(self->obj);
parent = GST_ELEMENT (gst_pad_get_parent (pad));
buf = g_strdup_printf ("<GstPad (%s:%s) at %lx>",
parent ? gst_element_get_name (parent) : "---",
gst_pad_get_name (pad), (long) self->obj);
padname = gst_pad_get_name (pad);
if (parent)
elementname = gst_element_get_name (parent);
buf = g_strdup_printf ("<GstPad (%s:%s) at %lx>",
parent ? elementname : "---",
padname, (long) self->obj);
if (parent) {
gst_object_unref (parent);
g_free(elementname);
}
g_free(padname);
retval = PyString_FromString(buf);
g_free(buf);
@ -1008,16 +1018,3 @@ _wrap_gst_pad_set_blocked_async (PyGObject *self, PyObject *args)
return pret;
}
/* %% */
/* override gst_pad_set_bufferalloc_function args */
/* static GstFlowReturn */
/* pad_set_bufferalloc_marshal (GstPad *pad, guint64 offset, guint size, */
/* GstCaps *caps, GstBuffer **buf) */
/* { */
/* } */
/* PyObject * */
/* _wrap_gst_pad_set_bufferalloc_function (PyGObject *self, PyObject *args) */
/* { */
/* } */

View file

@ -325,7 +325,7 @@ _wrap_gst_structure_from_string(PyObject *self, PyObject *args, PyObject *kwargs
ret = gst_structure_from_string(string, NULL);
/* pyg_boxed_new handles NULL checking */
return pyg_boxed_new(GST_TYPE_STRUCTURE, ret, TRUE, TRUE);
return pyg_boxed_new(GST_TYPE_STRUCTURE, ret, FALSE, TRUE);
}
%%
override-slot GstStructure.tp_dealloc

View file

@ -29,6 +29,8 @@ _wrap_emit_event (PyObject * self, PyObject *args)
event = gst_event_new_custom(event_type, NULL);
g_signal_emit_by_name(G_OBJECT(obj->obj), "event", event);
gst_mini_object_unref(GST_MINI_OBJECT(event));
Py_INCREF(Py_None);
return Py_None;