[vlc-devel] commit: playlist: Make sure the preparser and the fetcher releases all their waiting elements . (Pierre d'Herbemont )

git version control git at videolan.org
Sun Jul 6 23:34:17 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul  6 23:36:30 2008 +0200| [58159c007842b807e5f01d53f3ce728283c3be5f]

playlist: Make sure the preparser and the fetcher releases all their waiting elements.

Fix issue with leaked input item at exit.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58159c007842b807e5f01d53f3ce728283c3be5f
---

 src/playlist/engine.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 1a39ce5..603fdc3 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -601,6 +601,13 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
         msleep( (i_activity+1) * 1000 );
         vlc_object_lock( p_obj );
     }
+
+    for( int i = 0; i < p_obj->i_waiting; i++ )
+    {
+        vlc_gc_decref( p_obj->pp_waiting[i] );
+        REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
+    }
+
     vlc_object_unlock( p_obj );
 }
 
@@ -682,6 +689,13 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj )
         msleep( (i_activity+1) * 1000 );
         vlc_object_lock( p_obj );
     }
+
+    for( int i = 0; i < p_obj->i_waiting; i++ )
+    {
+        vlc_gc_decref( p_obj->pp_waiting[i] );
+        REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
+    }
+
     vlc_object_unlock( p_obj );
 }
 




More information about the vlc-devel mailing list