mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
gst/gstpad.override: Fix memory leak for functions that return a newly created buffer as a function argument.
Original commit message from CVS: * gst/gstpad.override: Fix memory leak for functions that return a newly created buffer as a function argument. Fixes #554545
This commit is contained in:
parent
7a2babed30
commit
75bd1f6f6d
2 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-12-06 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/gstpad.override:
|
||||||
|
Fix memory leak for functions that return a newly created buffer as
|
||||||
|
a function argument.
|
||||||
|
Fixes #554545
|
||||||
|
|
||||||
2008-12-06 Edward Hervey <edward.hervey@collabora.co.uk>
|
2008-12-06 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||||
|
|
||||||
* codegen/argtypes.py:
|
* codegen/argtypes.py:
|
||||||
|
|
|
@ -942,6 +942,9 @@ _wrap_gst_pad_add_event_probe(PyGObject *self, PyObject *args)
|
||||||
if (rv)
|
if (rv)
|
||||||
GST_PAD_DO_EVENT_SIGNALS (pad)++;
|
GST_PAD_DO_EVENT_SIGNALS (pad)++;
|
||||||
|
|
||||||
|
GST_PAD_DO_BUFFER_SIGNALS (pad)++;
|
||||||
|
GST_DEBUG ("adding event probe to pad %s:%s, now %d probes",
|
||||||
|
GST_DEBUG_PAD_NAME (pad), GST_PAD_DO_BUFFER_SIGNALS (pad));
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
Py_DECREF(myargs);
|
Py_DECREF(myargs);
|
||||||
|
@ -1140,6 +1143,9 @@ _wrap_gst_pad_alloc_buffer (PyGObject *self, PyObject * args, PyObject *kwargs)
|
||||||
PyList_SetItem(ret, 1, Py_None);
|
PyList_SetItem(ret, 1, Py_None);
|
||||||
} else {
|
} else {
|
||||||
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
||||||
|
/* Bring down the reference count, since we are meant to be the only
|
||||||
|
* one holding a reference to the newly created buffer. */
|
||||||
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1170,6 +1176,9 @@ _wrap_gst_pad_alloc_buffer_and_set_caps (PyGObject *self, PyObject * args, PyObj
|
||||||
PyList_SetItem(ret, 1, Py_None);
|
PyList_SetItem(ret, 1, Py_None);
|
||||||
} else {
|
} else {
|
||||||
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
||||||
|
/* Bring down the reference count, since we are meant to be the only
|
||||||
|
* one holding a reference to the newly created buffer. */
|
||||||
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1197,6 +1206,9 @@ _wrap_gst_pad_pull_range (PyGObject *self, PyObject * args, PyObject *kwargs)
|
||||||
PyList_SetItem(ret, 1, Py_None);
|
PyList_SetItem(ret, 1, Py_None);
|
||||||
} else {
|
} else {
|
||||||
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
||||||
|
/* Bring down the reference count, since we are meant to be the only
|
||||||
|
* one holding a reference to the newly created buffer. */
|
||||||
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1224,6 +1236,9 @@ _wrap_gst_pad_get_range (PyGObject *self, PyObject * args, PyObject *kwargs)
|
||||||
PyList_SetItem(ret, 1, Py_None);
|
PyList_SetItem(ret, 1, Py_None);
|
||||||
} else {
|
} else {
|
||||||
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
PyList_SetItem(ret, 1, pygstminiobject_new(GST_MINI_OBJECT(buf)));
|
||||||
|
/* Bring down the reference count, since we are meant to be the only
|
||||||
|
* one holding a reference to the newly created buffer. */
|
||||||
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue