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

playlist: delete items a.s.a.p.

parent 1fb88c4b
......@@ -222,7 +222,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
ARRAY_INIT( p_playlist->items );
ARRAY_INIT( p_playlist->all_items );
ARRAY_INIT( pl_priv(p_playlist)->items_to_delete );
ARRAY_INIT( p_playlist->current );
p_playlist->i_current_index = 0;
......@@ -338,12 +337,6 @@ void playlist_Destroy( playlist_t *p_playlist )
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 );
......
......@@ -308,15 +308,10 @@ int playlist_ItemRelease( playlist_item_t *p_item )
playlist_t *p_playlist = p_item->p_playlist;
PL_ASSERT_LOCKED;
/* Surprise, we can't actually do more because we
* don't do refcounting, or eauivalent.
* Because item are not only accessed by their id
* using playlist_item outside the PL_LOCK isn't safe.
* Most of the modules does that.
*
* Who wants to add proper memory management? */
uninstall_input_item_observer( p_item );
ARRAY_APPEND( pl_priv(p_playlist)->items_to_delete, p_item);
free( p_item->pp_children );
vlc_gc_decref( p_item->p_input );
free( p_item );
return VLC_SUCCESS;
}
......
......@@ -49,9 +49,6 @@ typedef struct playlist_private_t
playlist_t public_data;
struct intf_thread_t *interface; /**< Linked-list of interfaces */
playlist_item_array_t items_to_delete; /**< Array of items and nodes to
delete... At the very end. This sucks. */
vlc_sd_internal_t **pp_sds;
int i_sds; /**< Number of service discovery modules */
input_thread_t * p_input; /**< the input thread associated
......
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