[vlc-commits] commit: alsa: fix a memory leak. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Sun Jun 27 10:48:59 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jun 26 12:11:08 2010 +0200| [0ab21cd4df9ffdd74dcd0a7e1736ed4566bc5605] | committer: 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: Rémi Duraffort <ivoire at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=0ab21cd4df9ffdd74dcd0a7e1736ed4566bc5605
---

 modules/audio_output/alsa.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index dc48b91..3d1b613 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -867,6 +867,7 @@ static void ALSAFill( aout_instance_t * p_aout )
     if( p_buffer == NULL )
         goto error;
 
+    block_cleanup_push( p_buffer );
     for (;;)
     {
         int n = snd_pcm_poll_descriptors_count(p_pcm);
@@ -912,7 +913,7 @@ static void ALSAFill( aout_instance_t * p_aout )
         msg_Err( p_aout, "cannot write: %s", snd_strerror( i_snd_rc ) );
 
     vlc_restorecancel(canc);
-    block_Release( p_buffer );
+    vlc_cleanup_run();
     return;
 
 error:



More information about the vlc-commits mailing list