Commit 6914f254 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove playlist items when destroying the playlist...

...rather than when disabling it. Otherwise service discovery plugins
cannot possibly cleanup after themselves (and CABOOM).
parent cbe61094
...@@ -181,6 +181,24 @@ static void playlist_Destructor( vlc_object_t * p_this ) ...@@ -181,6 +181,24 @@ static void playlist_Destructor( vlc_object_t * p_this )
assert( !p_sys->p_fetcher ); assert( !p_sys->p_fetcher );
vlc_cond_destroy( &p_sys->signal ); vlc_cond_destroy( &p_sys->signal );
/* Remove all remaining items */
FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items )
free( p_del->pp_children );
vlc_gc_decref( p_del->p_input );
free( p_del );
FOREACH_END();
ARRAY_RESET( p_playlist->all_items );
FOREACH_ARRAY( playlist_item_t *p_del, p_sys->items_to_delete )
free( p_del->pp_children );
vlc_gc_decref( p_del->p_input );
free( p_del );
FOREACH_END();
ARRAY_RESET( p_sys->items_to_delete );
ARRAY_RESET( p_playlist->items );
ARRAY_RESET( p_playlist->current );
msg_Dbg( p_this, "Destroyed" ); msg_Dbg( p_this, "Destroyed" );
} }
......
...@@ -118,22 +118,6 @@ void playlist_Deactivate( playlist_t *p_playlist ) ...@@ -118,22 +118,6 @@ void playlist_Deactivate( playlist_t *p_playlist )
/* Release the current item */ /* Release the current item */
set_current_status_item( p_playlist, NULL ); set_current_status_item( p_playlist, NULL );
FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items )
free( p_del->pp_children );
vlc_gc_decref( p_del->p_input );
free( p_del );
FOREACH_END();
ARRAY_RESET( p_playlist->all_items );
FOREACH_ARRAY( playlist_item_t *p_del, p_sys->items_to_delete )
free( p_del->pp_children );
vlc_gc_decref( p_del->p_input );
free( p_del );
FOREACH_END();
ARRAY_RESET( p_sys->items_to_delete );
ARRAY_RESET( p_playlist->items );
ARRAY_RESET( p_playlist->current );
PL_UNLOCK; PL_UNLOCK;
msg_Dbg( p_playlist, "Deactivated" ); msg_Dbg( p_playlist, "Deactivated" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment