mpegtsmux: plug leaks when freeing stream

This commit is contained in:
Mark Nauwelaerts 2012-06-08 17:14:09 +02:00
parent 244f28c938
commit c2387d8bf6

View file

@ -214,8 +214,20 @@ tsmux_stream_get_pid (TsMuxStream * stream)
void void
tsmux_stream_free (TsMuxStream * stream) tsmux_stream_free (TsMuxStream * stream)
{ {
GList *cur;
g_return_if_fail (stream != NULL); g_return_if_fail (stream != NULL);
/* free buffers */
for (cur = stream->buffers; cur; cur = cur->next) {
TsMuxStreamBuffer *tmbuf = (TsMuxStreamBuffer *) cur->data;
if (stream->buffer_release)
stream->buffer_release (tmbuf->data, tmbuf->user_data);
g_slice_free (TsMuxStreamBuffer, tmbuf);
}
g_list_free (stream->buffers);
g_slice_free (TsMuxStream, stream); g_slice_free (TsMuxStream, stream);
} }