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