Commit 05dc64af authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

objects: Call vlc_object_join() automatically from vlc_object_destructor() if needed.

interaction: No need to call vlc_object_join() now.
parent dbdd540a
...@@ -47,7 +47,6 @@ static interaction_t * InteractionGet( vlc_object_t * ); ...@@ -47,7 +47,6 @@ static interaction_t * InteractionGet( vlc_object_t * );
static void InteractionSearchInterface( interaction_t * ); static void InteractionSearchInterface( interaction_t * );
static void InteractionLoop( vlc_object_t * ); static void InteractionLoop( vlc_object_t * );
static void InteractionManage( interaction_t * ); static void InteractionManage( interaction_t * );
static void interaction_Destructor( vlc_object_t *p_interaction );
static interaction_dialog_t *DialogGetById( interaction_t* , int ); static interaction_dialog_t *DialogGetById( interaction_t* , int );
static void DialogDestroy( interaction_dialog_t * ); static void DialogDestroy( interaction_dialog_t * );
...@@ -383,16 +382,9 @@ vlc_object_t * interaction_Init( libvlc_int_t *p_libvlc ) ...@@ -383,16 +382,9 @@ vlc_object_t * interaction_Init( libvlc_int_t *p_libvlc )
} }
} }
vlc_object_set_destructor( p_interaction, interaction_Destructor );
return VLC_OBJECT( p_interaction ); return VLC_OBJECT( p_interaction );
} }
static void interaction_Destructor( vlc_object_t *p_interaction )
{
vlc_thread_join( p_interaction );
}
/********************************************************************** /**********************************************************************
* The following functions are local * The following functions are local
**********************************************************************/ **********************************************************************/
......
...@@ -200,6 +200,7 @@ vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size, ...@@ -200,6 +200,7 @@ vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
p_priv->i_refcount = 1; p_priv->i_refcount = 1;
p_priv->pf_destructor = kVLCDestructor; p_priv->pf_destructor = kVLCDestructor;
p_priv->b_thread = VLC_FALSE;
p_new->p_parent = NULL; p_new->p_parent = NULL;
p_new->pp_children = NULL; p_new->pp_children = NULL;
p_new->i_children = 0; p_new->i_children = 0;
...@@ -419,6 +420,10 @@ static void vlc_object_destroy( vlc_object_t *p_this ) ...@@ -419,6 +420,10 @@ static void vlc_object_destroy( vlc_object_t *p_this )
/* Send a kill to the object's thread if applicable */ /* Send a kill to the object's thread if applicable */
vlc_object_kill( p_this ); vlc_object_kill( p_this );
/* If we are running on a thread, wait until it ends */
if( p_priv->b_thread )
vlc_thread_join( p_this );
/* Call the custom "subclass" destructor */ /* Call the custom "subclass" destructor */
if( p_priv->pf_destructor ) if( p_priv->pf_destructor )
p_priv->pf_destructor( p_this ); p_priv->pf_destructor( p_this );
......
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