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

interaction: safely join the thread

parent 8f231e30
...@@ -388,6 +388,16 @@ interaction_t * interaction_Init( libvlc_int_t *p_libvlc ) ...@@ -388,6 +388,16 @@ interaction_t * interaction_Init( libvlc_int_t *p_libvlc )
return p_interaction; return p_interaction;
} }
void interaction_Destroy( interaction_t *p_interaction )
{
if( !p_interaction )
return;
vlc_object_kill( p_interaction );
vlc_thread_join( p_interaction );
vlc_object_release( p_interaction );
}
/********************************************************************** /**********************************************************************
* The following functions are local * The following functions are local
**********************************************************************/ **********************************************************************/
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* Interaction * Interaction
**********************************************************************/ **********************************************************************/
/* release via vlc_object_release() */
interaction_t * interaction_Init( libvlc_int_t *p_libvlc ); interaction_t * interaction_Init( libvlc_int_t *p_libvlc );
void interaction_Destroy( interaction_t * );
#endif #endif
...@@ -964,7 +964,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc ) ...@@ -964,7 +964,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
/* Free interaction */ /* Free interaction */
msg_Dbg( p_libvlc, "removing interaction" ); msg_Dbg( p_libvlc, "removing interaction" );
vlc_object_release( priv->p_interaction ); interaction_Destroy( priv->p_interaction );
/* Free video outputs */ /* Free video outputs */
msg_Dbg( p_libvlc, "removing all video outputs" ); msg_Dbg( p_libvlc, "removing all video outputs" );
......
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