int do_ListDestroy( list_t *p_list ) { for( overlay_t **pp_cur = p_list->pp_head; pp_cur < p_list->pp_tail; ++pp_cur ) { if( *pp_cur != NULL ) { OverlayDestroy( *pp_cur ); free( *pp_cur ); } } free( p_list->pp_head ); return VLC_SUCCESS; }
int ListRemove( list_t *p_list, size_t i_idx ) { int ret; if( ( i_idx >= (size_t)( p_list->pp_tail - p_list->pp_head ) ) || ( p_list->pp_head[i_idx] == NULL ) ) { return VLC_EGENERIC; } ret = OverlayDestroy( p_list->pp_head[i_idx] ); free( p_list->pp_head[i_idx] ); p_list->pp_head[i_idx] = NULL; return ret; }