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 ) ...@@ -177,7 +177,6 @@ libvlc_int_t * libvlc_InternalCreate( void )
p_libvlc_global->b_ready = VLC_TRUE; p_libvlc_global->b_ready = VLC_TRUE;
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
/* Allocate a libvlc instance object */ /* Allocate a libvlc instance object */
p_libvlc = vlc_object_create( p_libvlc_global, VLC_OBJECT_LIBVLC ); 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 ) ...@@ -1056,7 +1055,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, vlc_bool_t b_release )
system_End( p_libvlc ); system_End( p_libvlc );
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Flush( p_libvlc ); msg_Flush( p_libvlc );
msg_Destroy( p_libvlc ); msg_Destroy( p_libvlc );
......
...@@ -147,8 +147,6 @@ void __module_InitBank( vlc_object_t *p_this ) ...@@ -147,8 +147,6 @@ void __module_InitBank( vlc_object_t *p_this )
p_libvlc_global->p_module_bank->i_usage++; p_libvlc_global->p_module_bank->i_usage++;
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
} }
...@@ -172,17 +170,14 @@ void __module_EndBank( vlc_object_t *p_this ) ...@@ -172,17 +170,14 @@ void __module_EndBank( vlc_object_t *p_this )
if( !p_libvlc_global->p_module_bank ) if( !p_libvlc_global->p_module_bank )
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return; return;
} }
if( --p_libvlc_global->p_module_bank->i_usage ) if( --p_libvlc_global->p_module_bank->i_usage )
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return; return;
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
/* Save the configuration */ /* Save the configuration */
config_AutoSaveConfigFile( p_this ); config_AutoSaveConfigFile( p_this );
...@@ -261,12 +256,10 @@ void __module_LoadBuiltins( vlc_object_t * p_this ) ...@@ -261,12 +256,10 @@ void __module_LoadBuiltins( vlc_object_t * p_this )
if( p_libvlc_global->p_module_bank->b_builtins ) if( p_libvlc_global->p_module_bank->b_builtins )
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return; return;
} }
p_libvlc_global->p_module_bank->b_builtins = VLC_TRUE; p_libvlc_global->p_module_bank->b_builtins = VLC_TRUE;
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Dbg( p_this, "checking builtin modules" ); msg_Dbg( p_this, "checking builtin modules" );
ALLOCATE_ALL_BUILTINS(); ALLOCATE_ALL_BUILTINS();
...@@ -292,12 +285,10 @@ void __module_LoadPlugins( vlc_object_t * p_this ) ...@@ -292,12 +285,10 @@ void __module_LoadPlugins( vlc_object_t * p_this )
if( p_libvlc_global->p_module_bank->b_plugins ) if( p_libvlc_global->p_module_bank->b_plugins )
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
return; return;
} }
p_libvlc_global->p_module_bank->b_plugins = VLC_TRUE; p_libvlc_global->p_module_bank->b_plugins = VLC_TRUE;
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
var_Destroy( p_libvlc_global, "libvlc" );
msg_Dbg( p_this, "checking plugin modules" ); 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