-/**
- * Destroy the playlist global thread.
- *
- * Deinits all things controlled by the playlist global thread
- * \param p_playlist the playlist thread to destroy
- * \return VLC_SUCCESS or an error
- */
-int playlist_ThreadDestroy( playlist_t * p_playlist )
-{
- // Tell playlist to go to last loop
- vlc_object_kill( p_playlist );
-
- // Kill preparser
- if( p_playlist->p_preparse )
- {
- vlc_object_kill( p_playlist->p_preparse );
- vlc_thread_join( p_playlist->p_preparse );
- free( p_playlist->p_preparse->pp_waiting );
- vlc_object_detach( p_playlist->p_preparse );
- vlc_object_release( p_playlist->p_preparse );
- }
-
- // Kill meta fetcher
- if( p_playlist->p_fetcher )
- {
- vlc_object_kill( p_playlist->p_fetcher );
- vlc_thread_join( p_playlist->p_fetcher );
- free( p_playlist->p_fetcher->p_waiting );
- vlc_object_detach( p_playlist->p_fetcher );
- vlc_object_release( p_playlist->p_fetcher );
- }
-
- // Wait for thread to complete
- vlc_thread_join( p_playlist );
-
- // Stats
- vlc_mutex_destroy( &p_playlist->p_stats->lock );
- if( p_playlist->p_stats )
- free( p_playlist->p_stats );
-
- DestroyInteraction( p_playlist );
-
- playlist_Destroy( p_playlist );
-
- return VLC_SUCCESS;
-}
-