]> git.sesse.net Git - vlc/commitdiff
playlist: wait for preparser end from playlist thread.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 21:20:56 +0000 (23:20 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 21:58:59 +0000 (23:58 +0200)
src/playlist/engine.c

index bb0f2e4c23637186a467d7d08893fd0300d8402a..2aa85d18dde10f3621fdca36d3f598face43d327 100644 (file)
@@ -170,15 +170,11 @@ static void playlist_Destructor( vlc_object_t * p_this )
 
     if( p_playlist->p_preparse )
     {
-        vlc_object_kill( p_playlist->p_preparse );
-        vlc_thread_join( p_playlist->p_preparse );
         vlc_object_release( p_playlist->p_preparse );
     }
 
     if( p_playlist->p_fetcher )
     {
-        vlc_object_kill( p_playlist->p_fetcher );
-        vlc_thread_join( p_playlist->p_fetcher );
         vlc_object_release( p_playlist->p_fetcher );
     }
     msg_Dbg( p_this, "Destroyed" );
@@ -508,6 +504,11 @@ void playlist_LastLoop( playlist_t *p_playlist )
     playlist_ServicesDiscoveryKillAll( p_playlist );
     playlist_MLDump( p_playlist );
 
+    vlc_object_kill( p_playlist->p_preparse );
+    vlc_thread_join( p_playlist->p_preparse );
+    vlc_object_kill( p_playlist->p_fetcher );
+    vlc_thread_join( p_playlist->p_fetcher );
+
     PL_LOCK;
     FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items )
         free( p_del->pp_children );