mirror of https://code.videolan.org/videolan/vlc
playlist_NodeRemoveItem(): set item's parent to NULL
This commit is contained in:
parent
56c70401a2
commit
afbc7600a3
|
@ -248,15 +248,23 @@ int playlist_NodeRemoveItem( playlist_t *p_playlist,
|
|||
PL_ASSERT_LOCKED;
|
||||
(void)p_playlist;
|
||||
|
||||
int ret = VLC_EGENERIC;
|
||||
|
||||
for(int i= 0; i< p_parent->i_children ; i++ )
|
||||
{
|
||||
if( p_parent->pp_children[i] == p_item )
|
||||
{
|
||||
REMOVE_ELEM( p_parent->pp_children, p_parent->i_children, i );
|
||||
ret = VLC_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return VLC_SUCCESS;
|
||||
if( ret == VLC_SUCCESS ) {
|
||||
assert( p_item->p_parent == p_parent );
|
||||
p_item->p_parent = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue