p_new->b_die = false;
p_new->b_error = false;
p_new->b_dead = false;
- p_priv->b_attached = false;
p_new->b_force = false;
p_new->psz_header = NULL;
p_libvlc_global->i_counter = 0;
p_libvlc_global->i_objects = 0;
p_libvlc_global->pp_objects = NULL;
- p_priv->b_attached = true;
vlc_mutex_init( &structure_lock );
}
else
{
p_libvlc_global = vlc_global();
if( i_type == VLC_OBJECT_LIBVLC )
- {
p_new->p_libvlc = (libvlc_int_t*)p_new;
- p_priv->b_attached = true;
- }
else
- {
p_new->p_libvlc = p_this->p_libvlc;
- }
}
vlc_spin_init( &p_priv->ref_spin );
INSERT_ELEM( p_parent->pp_children, p_parent->i_children,
p_parent->i_children, p_this );
- /* Climb up the tree to see whether we are connected with the root */
- if( vlc_internals( p_parent )->b_attached )
- {
- SetAttachment( p_this, true );
- }
-
vlc_mutex_unlock( &structure_lock );
}
{
assert (p_this->p_parent);
- /* Climb up the tree to see whether we are connected with the root */
- if( vlc_internals( p_this->p_parent )->b_attached )
- SetAttachment( p_this, false );
-
DetachObject( p_this );
}
pp_end = pp_current + p_libvlc_global->i_objects;
for( ; pp_current < pp_end ; pp_current++ )
- {
- if( vlc_internals(*pp_current)->b_attached )
- {
- PrintObject( *pp_current, "" );
- }
- else
- {
- printf( " o %.8i %s (not attached)\n",
- (*pp_current)->i_object_id,
- (*pp_current)->psz_object_type );
- }
- }
+ PrintObject( *pp_current, "" );
vlc_mutex_unlock( &structure_lock );
}
}
}
-/*****************************************************************************
- * 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;
-}
static void PrintObject( vlc_object_t *p_this, const char *psz_prefix )
{