Commit 0ab21cd4 authored by Rémi Duraffort's avatar Rémi Duraffort

alsa: fix a memory leak.

The thread can be canceled when owning a block_t, so we must push a way to clean it up.
(cherry picked from commit cc5b3af019db3893c84e4f09fef4277727151a84)
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent f37be1dc
...@@ -867,6 +867,7 @@ static void ALSAFill( aout_instance_t * p_aout ) ...@@ -867,6 +867,7 @@ static void ALSAFill( aout_instance_t * p_aout )
if( p_buffer == NULL ) if( p_buffer == NULL )
goto error; goto error;
block_cleanup_push( p_buffer );
for (;;) for (;;)
{ {
int n = snd_pcm_poll_descriptors_count(p_pcm); int n = snd_pcm_poll_descriptors_count(p_pcm);
...@@ -912,7 +913,7 @@ static void ALSAFill( aout_instance_t * p_aout ) ...@@ -912,7 +913,7 @@ static void ALSAFill( aout_instance_t * p_aout )
msg_Err( p_aout, "cannot write: %s", snd_strerror( i_snd_rc ) ); msg_Err( p_aout, "cannot write: %s", snd_strerror( i_snd_rc ) );
vlc_restorecancel(canc); vlc_restorecancel(canc);
block_Release( p_buffer ); vlc_cleanup_run();
return; return;
error: error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment