Commit 5882b259 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

hotkeys: appropriate var_FreeList()

parent 47e3ce98
...@@ -207,13 +207,6 @@ VLC_API int var_GetAndSet(vlc_object_t *obj, const char *name, int op, ...@@ -207,13 +207,6 @@ VLC_API int var_GetAndSet(vlc_object_t *obj, const char *name, int op,
*/ */
VLC_API int var_Inherit( vlc_object_t *, const char *, int, vlc_value_t * ); VLC_API int var_Inherit( vlc_object_t *, const char *, int, vlc_value_t * );
/**
* Frees a list and the associated strings.
* @param p_val: the list variable
* @param p_val2: the variable associated or NULL
*/
VLC_API void var_FreeList( vlc_list_t *, char *** );
/***************************************************************************** /*****************************************************************************
* Variable callbacks * Variable callbacks
......
...@@ -107,6 +107,26 @@ vlc_module_begin () ...@@ -107,6 +107,26 @@ vlc_module_begin ()
vlc_module_end () vlc_module_end ()
static void var_FreeList( vlc_list_t *values, char ***texts )
{
switch( values->i_type & VLC_VAR_CLASS )
{
case VLC_VAR_STRING:
for( int i = 0; i < values->i_count; i++ )
free( values->p_values[i].psz_string );
break;
}
free( values->p_values );
if( texts != NULL )
{
for( int i = 0; i < values->i_count; i++ )
free( (*texts)[i] );
free( *texts );
}
}
static int MovedEvent( vlc_object_t *p_this, char const *psz_var, static int MovedEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
......
...@@ -486,7 +486,6 @@ var_Create ...@@ -486,7 +486,6 @@ var_Create
var_DelCallback var_DelCallback
var_DelListCallback var_DelListCallback
var_Destroy var_Destroy
var_FreeList
var_Get var_Get
var_GetAndSet var_GetAndSet
var_GetChecked var_GetChecked
......
...@@ -1124,26 +1124,6 @@ error: ...@@ -1124,26 +1124,6 @@ error:
return VLC_EGENERIC; return VLC_EGENERIC;
} }
void var_FreeList( vlc_list_t *values, char ***texts )
{
switch( values->i_type & VLC_VAR_CLASS )
{
case VLC_VAR_STRING:
for( int i = 0; i < values->i_count; i++ )
free( values->p_values[i].psz_string );
break;
}
free( values->p_values );
if( texts != NULL )
{
for( int i = 0; i < values->i_count; i++ )
free( (*texts)[i] );
free( *texts );
}
}
static void DumpVariable(const void *data, const VISIT which, const int depth) static void DumpVariable(const void *data, const VISIT which, const int depth)
{ {
if (which != postorder && which != leaf) if (which != postorder && which != leaf)
......
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