-static void DetachObject( vlc_object_t *p_this )
-{
- vlc_object_t *p_parent = p_this->p_parent;
- int i_index, i;
-
- /* Remove p_this's parent */
- p_this->p_parent = NULL;
-
- /* Remove all of p_parent's children which are p_this */
- for( i_index = p_parent->i_children ; i_index-- ; )
- {
- if( p_parent->pp_children[i_index] == p_this )
- {
- p_parent->i_children--;
- for( i = i_index ; i < p_parent->i_children ; i++ )
- {
- p_parent->pp_children[i] = p_parent->pp_children[i+1];
- }
- }
- }
-
- if( p_parent->i_children )
- {
- p_parent->pp_children = (vlc_object_t **)realloc( p_parent->pp_children,
- p_parent->i_children * sizeof(vlc_object_t *) );
- }
- else
- {
- free( p_parent->pp_children );
- p_parent->pp_children = NULL;
- }
-}
-
-/*****************************************************************************
- * SetAttachment: recursively set the b_attached flag of a subtree.
- *****************************************************************************
- * This function is used by the attach and detach functions to propagate
- * the b_attached flag in a subtree.
- *****************************************************************************/
-static void SetAttachment( vlc_object_t *p_this, bool b_attached )
-{
- int i_index;
-
- for( i_index = p_this->i_children ; i_index-- ; )
- {
- SetAttachment( p_this->pp_children[i_index], b_attached );
- }
-
- vlc_internals( p_this )->b_attached = b_attached;
-}