]> git.sesse.net Git - vlc/commitdiff
Do NOT destroy the "libvlc"/global/bank/whatever lock variable.
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 30 Mar 2008 14:05:55 +0000 (17:05 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 30 Mar 2008 14:15:09 +0000 (17:15 +0300)
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).

src/libvlc-common.c
src/modules/modules.c

index a1625bb4b8e7047a3a5f354d0cc473a2d877c19a..6ffa129ab017d313cb8db36db33cca6574896a59 100644 (file)
@@ -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 );
index 87500c4b55b1939ce4dbc8f24761b4ece173cb20..1aead7ee2cb53457701654fbaa976050b0be2a2c 100644 (file)
@@ -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" );