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

Do NOT destroy the "libvlc"/global/bank/whatever lock variable.

The whole point of a global lock is that it is... global. Destroying it
every time it's released is severe brain damage, as we end up taking a
different lock all the time (or worse destroying the lock while another
threads is competing for it).
parent 30267d38
......@@ -177,7 +177,6 @@ libvlc_int_t * libvlc_InternalCreate( void )
p_libvlc_global->b_ready = VLC_TRUE;
}
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
/* Allocate a libvlc instance object */
p_libvlc = vlc_object_create( p_libvlc_global, VLC_OBJECT_LIBVLC );
......@@ -1056,7 +1055,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, vlc_bool_t b_release )
system_End( p_libvlc );
}
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Flush( p_libvlc );
msg_Destroy( p_libvlc );
......
......@@ -147,8 +147,6 @@ void __module_InitBank( vlc_object_t *p_this )
p_libvlc_global->p_module_bank->i_usage++;
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
}
......@@ -172,17 +170,14 @@ void __module_EndBank( vlc_object_t *p_this )
if( !p_libvlc_global->p_module_bank )
{
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return;
}
if( --p_libvlc_global->p_module_bank->i_usage )
{
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return;
}
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
/* Save the configuration */
config_AutoSaveConfigFile( p_this );
......@@ -261,12 +256,10 @@ void __module_LoadBuiltins( vlc_object_t * p_this )
if( p_libvlc_global->p_module_bank->b_builtins )
{
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return;
}
p_libvlc_global->p_module_bank->b_builtins = VLC_TRUE;
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Dbg( p_this, "checking builtin modules" );
ALLOCATE_ALL_BUILTINS();
......@@ -292,12 +285,10 @@ void __module_LoadPlugins( vlc_object_t * p_this )
if( p_libvlc_global->p_module_bank->b_plugins )
{
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return;
}
p_libvlc_global->p_module_bank->b_plugins = VLC_TRUE;
vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Dbg( p_this, "checking plugin modules" );
......
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