}
-#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
*
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 );
}