]> git.sesse.net Git - vlc/blobdiff - src/misc/variables.c
Remove vlc_global()
[vlc] / src / misc / variables.c
index ad297c60d78bfb1bc073523b2366bc8df48b4ba1..4a6d8e908d0f5d821a85d9ba77d1cd4f3d09b56d 100644 (file)
@@ -849,25 +849,6 @@ int __var_Get( vlc_object_t *p_this, const char *psz_name, vlc_value_t *p_val )
 }
 
 
-#undef var_AcquireMutex
-/**
- * Finds a process-wide mutex, creates it if needed, and locks it.
- * Unlock with vlc_mutex_unlock().
- */
-vlc_mutex_t *var_AcquireMutex( const char *name )
-{
-    libvlc_global_data_t *p_global = vlc_global();
-    vlc_value_t val;
-
-    if( var_Create( p_global, name, VLC_VAR_MUTEX ) )
-        return NULL;
-
-    var_Get( p_global, name, &val );
-    vlc_mutex_lock( val.p_address );
-    return val.p_address;
-}
-
-
 /**
  * Register a callback in a variable
  *
@@ -1163,6 +1144,10 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
 
     var_Set( p_obj, psz_name, val );
 
+    // If that's a list, remove all elements allocated
+    if( i_type == VLC_VAR_LIST )
+        FreeList( &val );
+
 cleanup:
     free( psz_name );
 }