]> git.sesse.net Git - vlc/commitdiff
playlist: Make sure the preparser and the fetcher releases all their waiting elements.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 21:36:30 +0000 (23:36 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 21:36:30 +0000 (23:36 +0200)
Fix issue with leaked input item at exit.

src/playlist/engine.c

index 1a39ce50f9ae7faac2f0e70e5c366bd6fe25da35..603fdc3dd7160db1fbe8a255ee65932b64f071f8 100644 (file)
@@ -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 );
 }