mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 13:11:06 +00:00
We don't want to teach you bad habbits, so here's a fix for a memleak in the example plugin.
Original commit message from CVS: We don't want to teach you bad habbits, so here's a fix for a memleak in the example plugin.
This commit is contained in:
parent
5c43234108
commit
a7566d4158
2 changed files with 8 additions and 0 deletions
|
@ -266,6 +266,10 @@ gst_example_chain (GstPad *pad, GstBuffer *buf)
|
|||
/* Then copy the data in the incoming buffer into the new buffer. */
|
||||
memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (outbuf));
|
||||
|
||||
/* we don't need the incomming buffer anymore so we unref it. When we are
|
||||
* the last plugin with a handle to the buffer, its memory will be freed */
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
/* When we're done with the buffer, we push it on to the next element
|
||||
* in the pipeline, through the element's source pad, which is stored
|
||||
* in the element's structure.
|
||||
|
|
|
@ -266,6 +266,10 @@ gst_example_chain (GstPad *pad, GstBuffer *buf)
|
|||
/* Then copy the data in the incoming buffer into the new buffer. */
|
||||
memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (outbuf));
|
||||
|
||||
/* we don't need the incomming buffer anymore so we unref it. When we are
|
||||
* the last plugin with a handle to the buffer, its memory will be freed */
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
/* When we're done with the buffer, we push it on to the next element
|
||||
* in the pipeline, through the element's source pad, which is stored
|
||||
* in the element's structure.
|
||||
|
|
Loading…
Reference in a new issue