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

core: intf: simplify intf_DestroyAll()

parent 0005aed6
...@@ -145,28 +145,23 @@ error: ...@@ -145,28 +145,23 @@ error:
*/ */
void intf_DestroyAll( libvlc_int_t *p_libvlc ) void intf_DestroyAll( libvlc_int_t *p_libvlc )
{ {
intf_thread_t *p_first; intf_thread_t *p_intf;
vlc_mutex_lock( &lock ); vlc_mutex_lock( &lock );
p_first = libvlc_priv( p_libvlc )->p_intf; p_intf = libvlc_priv( p_libvlc )->p_intf;
#ifndef NDEBUG #ifndef NDEBUG
libvlc_priv( p_libvlc )->p_intf = NULL; libvlc_priv( p_libvlc )->p_intf = NULL;
#endif #endif
vlc_mutex_unlock( &lock ); vlc_mutex_unlock( &lock );
/* Tell the interfaces to die */
for( intf_thread_t *p_intf = p_first; p_intf; p_intf = p_intf->p_next )
vlc_object_kill( p_intf );
/* Cleanup the interfaces */ /* Cleanup the interfaces */
for( intf_thread_t *p_intf = p_first; p_intf != NULL; ) while( p_intf != NULL )
{ {
intf_thread_t *p_next = p_intf->p_next; intf_thread_t *p_next = p_intf->p_next;
module_unneed( p_intf, p_intf->p_module ); module_unneed( p_intf, p_intf->p_module );
config_ChainDestroy( p_intf->p_cfg ); config_ChainDestroy( p_intf->p_cfg );
vlc_object_release( p_intf ); vlc_object_release( p_intf );
p_intf = p_next; p_intf = p_next;
} }
} }
......
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