X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmisc%2Fvariables.c;h=4a6d8e908d0f5d821a85d9ba77d1cd4f3d09b56d;hb=80cb294832cf77b8440957d75d24cae2ec853d0c;hp=ad297c60d78bfb1bc073523b2366bc8df48b4ba1;hpb=a1af59d67785b481efebef5b5db311b51ed05343;p=vlc diff --git a/src/misc/variables.c b/src/misc/variables.c index ad297c60d7..4a6d8e908d 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -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 ); }