Commit 46a33c34 authored by Rémi Duraffort's avatar Rémi Duraffort

gestures: fix memleak with var_Change(VLC_VAR_GETCHOICES).

parent 128bfa77
...@@ -306,8 +306,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -306,8 +306,8 @@ static void RunIntf( intf_thread_t *p_intf )
case GESTURE(UP,RIGHT,NONE,NONE): case GESTURE(UP,RIGHT,NONE,NONE):
{ {
vlc_value_t val, list, list2; vlc_value_t val, list, list2;
int i_count, i; int i_count, i;
p_playlist = pl_Hold( p_intf ); p_playlist = pl_Hold( p_intf );
p_input = playlist_CurrentInput( p_playlist ); p_input = playlist_CurrentInput( p_playlist );
...@@ -316,20 +316,22 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -316,20 +316,22 @@ static void RunIntf( intf_thread_t *p_intf )
if( !p_input ) if( !p_input )
break; break;
var_Get( p_input, "audio-es", &val ); var_Get( p_input, "audio-es", &val );
var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
i_count = list.p_list->i_count; i_count = list.p_list->i_count;
if( i_count <= 1 ) if( i_count <= 1 )
{ {
vlc_object_release( p_input ); var_Change( p_input, "audio-es", VLC_VAR_FREELIST, &list,
break; &list2 );
} vlc_object_release( p_input );
for( i = 0; i < i_count; i++ ) break;
{ }
if( val.i_int == list.p_list->p_values[i].i_int ) for( i = 0; i < i_count; i++ )
break; {
} if( val.i_int == list.p_list->p_values[i].i_int )
break;
}
/* value of audio-es was not in choices list */ /* value of audio-es was not in choices list */
if( i == i_count ) if( i == i_count )
{ {
...@@ -342,6 +344,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -342,6 +344,8 @@ static void RunIntf( intf_thread_t *p_intf )
else else
i++; i++;
var_Set( p_input, "audio-es", list.p_list->p_values[i] ); var_Set( p_input, "audio-es", list.p_list->p_values[i] );
var_Change( p_input, "audio-es", VLC_VAR_FREELIST, &list,
&list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
break; break;
...@@ -365,6 +369,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -365,6 +369,8 @@ static void RunIntf( intf_thread_t *p_intf )
if( i_count <= 1 ) if( i_count <= 1 )
{ {
vlc_object_release( p_input ); vlc_object_release( p_input );
var_Change( p_input, "spu-es", VLC_VAR_FREELIST,
&list, &list2 );
break; break;
} }
for( i = 0; i < i_count; i++ ) for( i = 0; i < i_count; i++ )
...@@ -386,6 +392,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -386,6 +392,8 @@ static void RunIntf( intf_thread_t *p_intf )
else else
i++; i++;
var_Set( p_input, "spu-es", list.p_list->p_values[i] ); var_Set( p_input, "spu-es", list.p_list->p_values[i] );
var_Change( p_input, "spu-es", VLC_VAR_FREELIST,
&list, &list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
break; break;
......
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