stream: free formats and transport in destroy()

This commit is contained in:
David Svensson Fors 2017-01-25 13:10:52 +01:00 committed by Wim Taymans
parent dda5a22fcd
commit dac9755765

View file

@ -259,6 +259,7 @@ void
pinos_stream_destroy (PinosStream *stream) pinos_stream_destroy (PinosStream *stream)
{ {
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this); PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
int i;
pinos_log_debug ("stream %p: destroy", stream); pinos_log_debug ("stream %p: destroy", stream);
@ -271,6 +272,13 @@ pinos_stream_destroy (PinosStream *stream)
if (impl->node_proxy) if (impl->node_proxy)
pinos_signal_remove (&impl->node_proxy_destroy); pinos_signal_remove (&impl->node_proxy_destroy);
if (impl->possible_formats) {
for (i = 0; i < impl->n_possible_formats; i++) {
free (impl->possible_formats[i]);
}
free (impl->possible_formats);
}
if (impl->format) if (impl->format)
free (impl->format); free (impl->format);
@ -286,6 +294,9 @@ pinos_stream_destroy (PinosStream *stream)
if (stream->properties) if (stream->properties)
pinos_properties_free (stream->properties); pinos_properties_free (stream->properties);
if (impl->trans)
pinos_transport_destroy (impl->trans);
if (stream->name) if (stream->name)
free (stream->name); free (stream->name);