]> git.sesse.net Git - vlc/blobdiff - src/misc/variables.c
Merge branch '1.0-bugfix'
[vlc] / src / misc / variables.c
index 52a7f7e5897bdf8567fc0b0919a4627172d42093..313f7000a29275009e1c14d2c4e61d60b4c8c854 100644 (file)
@@ -605,20 +605,6 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
                 }
             }
             break;
-        case VLC_VAR_FREELIST:
-            FreeList( p_val );
-            if( p_val2 && p_val2->p_list )
-            {
-                for( i = 0; i < p_val2->p_list->i_count; i++ )
-                    free( p_val2->p_list->p_values[i].psz_string );
-                if( p_val2->p_list->i_count )
-                {
-                    free( p_val2->p_list->p_values );
-                    free( p_val2->p_list->pi_types );
-                }
-                free( p_val2->p_list );
-            }
-            break;
         case VLC_VAR_SETTEXT:
             free( p_var->psz_text );
             if( p_val && p_val->psz_string )
@@ -1535,3 +1521,25 @@ int __var_Command( vlc_object_t *p_this, const char *psz_name,
 
     return i_ret;
 }
+
+
+/**
+ * Free a list and the associated strings
+ * @param p_val: the list variable
+ * @param p_val2: the variable associated or NULL
+ */
+void var_FreeList( vlc_value_t *p_val, vlc_value_t *p_val2 )
+{
+    FreeList( p_val );
+    if( p_val2 && p_val2->p_list )
+    {
+        for( int i = 0; i < p_val2->p_list->i_count; i++ )
+            free( p_val2->p_list->p_values[i].psz_string );
+        if( p_val2->p_list->i_count )
+        {
+            free( p_val2->p_list->p_values );
+            free( p_val2->p_list->pi_types );
+        }
+        free( p_val2->p_list );
+    }
+}