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

input: add explicit input_item_node_RemoveNode()

This is rarely used (only once in the whole code base).
parent b59334a5
......@@ -203,6 +203,12 @@ VLC_API input_item_node_t * input_item_node_AppendItem( input_item_node_t *p_nod
*/
VLC_API void input_item_node_AppendNode( input_item_node_t *p_parent, input_item_node_t *p_child );
/**
* Remove a node from its parent.
*/
void input_item_node_RemoveNode( input_item_node_t *parent,
input_item_node_t *child );
/**
* Delete a node created with input_item_node_Create() and all its children.
*/
......
......@@ -617,6 +617,8 @@ static void fsdir_attach_slaves(struct access_fsdir *p_fsdir)
* added in the parent node */
if (p_fsdir_slave->p_node != NULL)
{
input_item_node_RemoveNode(p_fsdir->p_node,
p_fsdir_slave->p_node);
input_item_node_Delete(p_fsdir_slave->p_node);
p_fsdir_slave->p_node = NULL;
}
......
......@@ -1261,9 +1261,7 @@ static void RecursiveNodeDelete( input_item_node_t *p_node )
void input_item_node_Delete( input_item_node_t *p_node )
{
if( p_node->p_parent )
TAB_REMOVE(p_node->p_parent->i_children, p_node->p_parent->pp_children,
p_node);
input_item_node_RemoveNode(node->p_parent, node);
RecursiveNodeDelete( p_node );
}
......@@ -1294,6 +1292,13 @@ void input_item_node_AppendNode( input_item_node_t *p_parent, input_item_node_t
p_child->p_parent = p_parent;
}
void input_item_node_RemoveNode( input_item_node_t *parent,
input_item_node_t *child )
{
TAB_REMOVE(parent->i_children, parent->pp_children, child);
child->p_parent = NULL;
}
void input_item_node_PostAndDelete( input_item_node_t *p_root )
{
vlc_event_send( &p_root->p_item->event_manager, &(vlc_event_t) {
......
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