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

Replace vlc_gc_decref() with input_item_Release()

parent 763cea5e
......@@ -59,7 +59,7 @@ static inline fingerprint_request_t *fingerprint_request_New( input_item_t *p_it
static inline void fingerprint_request_Delete( fingerprint_request_t *p_f )
{
vlc_gc_decref( p_f->p_item );
input_item_Release( p_f->p_item );
free( p_f->results.psz_fingerprint );
for( size_t i = 0; i < vlc_array_count( & p_f->results.metas_array ); i++ )
vlc_meta_Delete( (vlc_meta_t *) vlc_array_item_at_index( & p_f->results.metas_array, i ) );
......
......@@ -366,9 +366,6 @@ VLC_API input_item_t *input_item_Hold(input_item_t *);
/** Releases an input item, i.e. decrements its reference counter. */
VLC_API void input_item_Release(input_item_t *);
/* Historical hack... */
#define vlc_gc_decref(i) input_item_Release(i)
typedef enum input_item_meta_request_option_t
{
META_REQUEST_OPTION_NONE = 0x00,
......
......@@ -431,7 +431,7 @@ libvlc_media_t *libvlc_media_new_location( libvlc_instance_t *p_instance,
p_md = libvlc_media_new_from_input_item( p_instance, p_input_item );
/* The p_input_item is retained in libvlc_media_new_from_input_item */
vlc_gc_decref( p_input_item );
input_item_Release( p_input_item );
return p_md;
}
......@@ -555,7 +555,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
if( p_md->p_subitems )
libvlc_media_list_release( p_md->p_subitems );
vlc_gc_decref( p_md->p_input_item );
input_item_Release( p_md->p_input_item );
vlc_cond_destroy( &p_md->parsed_cond );
vlc_mutex_destroy( &p_md->parsed_lock );
......
......@@ -253,7 +253,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
p_input_item );
if( !p_md )
{
vlc_gc_decref( p_input_item );
input_item_Release( p_input_item );
return -1;
}
......
......@@ -85,7 +85,7 @@ static void entry_item_remove( services_discovery_t *p_sd,
if( p_entry_item->p_entry == p_entry )
{
services_discovery_RemoveItem( p_sd, p_entry_item->p_item );
vlc_gc_decref( p_entry_item->p_item );
input_item_Release( p_entry_item->p_item );
vlc_array_remove( &p_sys->entry_item_list, i );
free( p_entry_item );
break;
......@@ -114,7 +114,7 @@ static void netbios_ns_discover_on_entry_added( void *p_opaque,
free(psz_mrl);
entry_item_append( p_sd, p_entry, p_item );
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
}
......@@ -177,7 +177,7 @@ void bdsm_SdClose (vlc_object_t *p_this)
struct entry_item *p_entry_item;
p_entry_item = vlc_array_item_at_index( &p_sys->entry_item_list, i );
vlc_gc_decref( p_entry_item->p_item );
input_item_Release( p_entry_item->p_item );
free( p_entry_item );
}
vlc_array_clear( &p_sys->entry_item_list );
......
......@@ -1298,7 +1298,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
msg_rc( "Trying to add %s to playlist.", newval.psz_string );
int i_ret = playlist_AddInput( p_playlist, p_item,
PLAYLIST_GO, true );
vlc_gc_decref( p_item );
input_item_Release( p_item );
if( i_ret != VLC_SUCCESS )
{
return VLC_EGENERIC;
......
......@@ -885,7 +885,7 @@ static int Open( vlc_object_t * p_this )
input_item_t *p_item = input_item_New( psz_ref, NULL );
input_item_CopyOptions( p_item, p_current );
input_item_node_AppendItem( p_subitems, p_item );
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
else
{
......
......@@ -460,7 +460,7 @@ static int Demux( demux_t *p_demux )
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
else
/* Entry Handler */
......@@ -496,7 +496,7 @@ error:
input_item_node_Delete( p_subitems );
if( p_stream )
vlc_stream_Delete( p_stream );
vlc_gc_decref( p_current_input );
input_item_Release( p_current_input );
return 0;
}
......@@ -204,7 +204,7 @@ static int Demux( demux_t *p_demux )
msg_Err( p_demux, "Unsupported meta bitrate" );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
FREENULL( psz_title );
FREENULL( psz_mrl );
FREENULL( psz_genre );
......@@ -230,7 +230,7 @@ end:
if( p_subitems )
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref( p_current_input );
input_item_Release( p_current_input );
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
return i_ret;
......
......@@ -68,7 +68,7 @@ int Import_DVB(vlc_object_t *p_this)
input_item_t *item = ParseLine(line);
if (item == NULL)
return VLC_EGENERIC;
vlc_gc_decref(item);
input_item_Release(item);
msg_Dbg(demux, "found valid channels.conf file");
demux->pf_control = Control;
......@@ -92,11 +92,11 @@ static int Demux(demux_t *demux)
continue;
input_item_node_AppendItem(subitems, item);
vlc_gc_decref(item);
input_item_Release(item);
}
input_item_node_PostAndDelete(subitems);
vlc_gc_decref(input);
input_item_Release(input);
return 0; /* Needed for correct operation of go back */
}
......
......@@ -172,12 +172,12 @@ static int Demux( demux_t *p_demux )
SADD_INFO( "docid", psz_docid );
SADD_INFO( "description", psz_desc );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
free( psz_version );
free( psz_url );
......
......@@ -107,9 +107,9 @@ static int Demux( demux_t *p_demux )
input_item_t *p_current_input = GetCurrentItem(p_demux);
input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
free( psz_url );
return 0; /* Needed for correct operation of go back */
......@@ -131,9 +131,9 @@ static int DemuxDVD_VR( demux_t *p_demux )
input_item_t *p_input = input_item_New( psz_url, psz_url );
input_item_PostSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
free( psz_url );
return 0; /* Needed for correct operation of go back */
......
......@@ -113,7 +113,7 @@ int Demux( demux_t *p_demux )
pl_elements );
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
end:
if( p_xml_reader )
......@@ -334,7 +334,7 @@ static bool parse_track_dict( demux_t *p_demux, input_item_node_t *p_input_node,
/* add meta info */
add_meta( p_new_input, p_track );
vlc_gc_decref( p_new_input );
input_item_Release( p_new_input );
p_demux->p_sys->i_ntracks++;
......
......@@ -272,7 +272,7 @@ static int Demux( demux_t *p_demux )
input_item_SetArtURL( p_input, psz_album_art );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
error:
......@@ -298,7 +298,7 @@ static int Demux( demux_t *p_demux )
}
}
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
......
......@@ -134,7 +134,7 @@ static int Demux( demux_t *p_demux )
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
free( psz_mrl_orig );
psz_mrl_orig = psz_mrl = NULL;
}
......@@ -179,7 +179,7 @@ static int Demux( demux_t *p_demux )
p_input = input_item_New( psz_mrl, psz_name );
input_item_CopyOptions( p_input, p_current_input );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
free( psz_mrl_orig );
}
else
......@@ -191,7 +191,7 @@ static int Demux( demux_t *p_demux )
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
free( psz_prefix );
return 0; /* Needed for correct operation of go back */
}
......@@ -297,7 +297,7 @@ static int Demux( demux_t *p_demux )
FREENULL( psz_item_size );
}
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
b_item = false;
}
else if( !strcmp( node, "image" ) )
......@@ -319,7 +319,7 @@ static int Demux( demux_t *p_demux )
xml_ReaderDelete( p_xml_reader );
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
return 0; /* Needed for correct operation of go back */
error:
......@@ -342,7 +342,7 @@ error:
if( p_subitems )
input_item_node_Delete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
return -1;
}
......
......@@ -244,13 +244,13 @@ static int Demux( demux_t *p_demux )
SADD_INFO( "href", psz_href );
SADD_INFO( _("Mime"), psz_mimetype );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
if( psz_qtnext )
{
vlc_xml_decode( psz_qtnext );
p_input = input_item_New( psz_qtnext, NULL );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
input_item_node_PostAndDelete( p_subitems );
}
......@@ -261,7 +261,7 @@ error:
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
free( psz_href );
free( psz_moviename );
......
......@@ -347,7 +347,7 @@ static int Demux( demux_t *p_demux )
if( !EMPTY_STR( psz_comments ) ) input_item_SetDescription( p_input, psz_comments );
input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
free( psz_mrl );
}
......@@ -379,7 +379,7 @@ static int Demux( demux_t *p_demux )
}
}
input_item_node_PostAndDelete( p_subitems );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
free(psz_prefix);
return 0; /* Needed for correct operation of go back */
......
......@@ -400,7 +400,7 @@ static int Demux ( demux_t *p_demux )
input_item_AddOption( p_child, "rtsp-kasenna", VLC_INPUT_OPTION_TRUSTED );
input_item_PostSubItem( p_current_input, p_child );
vlc_gc_decref( p_child );
vlc_gc_decref(p_current_input);
input_item_Release( p_child );
input_item_Release(p_current_input);
return 0; /* Needed for correct operation of go back */
}
......@@ -120,7 +120,7 @@ error:
if( p_xml_reader )
xml_ReaderDelete( p_xml_reader );
if( p_input_node ) input_item_node_Delete( p_input_node );
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
return i_ret;
}
......@@ -176,7 +176,7 @@ static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
input_item_CopyOptions( p_input, p_input_node->p_item );
free( psz_mrl );
input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
FREENULL( psz_name );
}
......@@ -343,7 +343,7 @@ static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
if( psz_rt )
input_item_SetRating( p_input, psz_rt );
input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
FREENULL( psz_base );
FREENULL( psz_name );
......
......@@ -103,7 +103,7 @@ void Close_xspf(vlc_object_t *p_this)
demux_sys_t *p_sys = p_demux->p_sys;
for (int i = 0; i < p_sys->i_tracklist_entries; i++)
if (p_sys->pp_tracklist[i])
vlc_gc_decref(p_sys->pp_tracklist[i]);
input_item_Release(p_sys->pp_tracklist[i]);
free(p_sys->pp_tracklist);
free(p_sys->psz_base);
free(p_sys);
......@@ -160,7 +160,7 @@ static int Demux(demux_t *p_demux)
input_item_node_PostAndDelete(p_subitems);
end:
vlc_gc_decref(p_current_input);
input_item_Release(p_current_input);
if (p_xml_reader)
xml_ReaderDelete(p_xml_reader);
return i_ret; /* Needed for correct operation of go back */
......@@ -440,7 +440,7 @@ static bool parse_track_node COMPLEX_INTERFACE
|| (size_t)p_sys->i_track_id >= (SIZE_MAX / sizeof(p_new_input)))
{
input_item_node_AppendNode(p_input_node, p_new_node);
vlc_gc_decref(p_new_input);
input_item_Release(p_new_input);
return true;
}
......@@ -451,7 +451,7 @@ static bool parse_track_node COMPLEX_INTERFACE
(p_sys->i_track_id + 1) * sizeof(*pp));
if (!pp)
{
vlc_gc_decref(p_new_input);
input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
return false;
}
......@@ -462,7 +462,7 @@ static bool parse_track_node COMPLEX_INTERFACE
else if (p_sys->pp_tracklist[p_sys->i_track_id] != NULL)
{
msg_Err(p_demux, "track ID %d collision", p_sys->i_track_id);
vlc_gc_decref(p_new_input);
input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
return false;
}
......@@ -514,7 +514,7 @@ static bool parse_track_node COMPLEX_INTERFACE
end:
vlc_gc_decref(p_new_input);
input_item_Release(p_new_input);
input_item_node_Delete(p_new_node);
free(psz_value);
return false;
......@@ -676,7 +676,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{
msg_Err(p_demux, "invalid xml stream");
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
/* choose handler */
......@@ -685,7 +685,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
{
msg_Err(p_demux, "unexpected element <%s>", name);
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
/* complex content is parsed in a separate function */
......@@ -702,7 +702,8 @@ static bool parse_extension_node COMPLEX_INTERFACE
else
{
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item)
input_item_Release(p_new_input);
return false;
}
}
......@@ -715,7 +716,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
if (unlikely(!psz_value))
{
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
break;
......@@ -726,7 +727,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
if (!strcmp(name, psz_element))
{
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
return true;
}
/* there MUST have been a start tag for that element name */
......@@ -736,7 +737,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
msg_Err(p_demux, "there's no open element left for <%s>",
name);
FREE_VALUE();
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
return false;
}
......@@ -755,7 +756,7 @@ static bool parse_extension_node COMPLEX_INTERFACE
break;
}
}
if (b_release_input_item) vlc_gc_decref(p_new_input);
if (b_release_input_item) input_item_Release(p_new_input);
free(psz_value);
return false;
}
......@@ -798,7 +799,7 @@ static bool parse_extitem_node COMPLEX_INTERFACE
if (p_new_input)
{
input_item_node_AppendItem(p_input_node, p_new_input);
vlc_gc_decref(p_new_input);
input_item_Release(p_new_input);
p_demux->p_sys->pp_tracklist[i_tid] = NULL;
}
......
......@@ -301,7 +301,7 @@
msg_Err(getIntf(), "CAS: playlist add input failed :(");
/* we're done with this input */
vlc_gc_decref(p_input);
input_item_Release(p_input);
[self.window performClose:sender];
}
......
......@@ -123,7 +123,7 @@
- (void)dealloc
{
if (p_item)
vlc_gc_decref(p_item);
input_item_Release(p_item);
}
- (void)updateCocoaWindowLevel:(NSInteger)i_level
......@@ -178,7 +178,7 @@
{
if (_p_item != p_item) {
if (p_item)
vlc_gc_decref(p_item);
input_item_Release(p_item);
[_saveMetaDataButton setEnabled: NO];
if (_p_item)
input_item_Hold(_p_item);
......
......@@ -773,12 +773,12 @@ CoverArtLabel::~CoverArtLabel()
QList< QAction* > artActions = actions();
foreach( QAction *act, artActions )
removeAction( act );
if ( p_item ) vlc_gc_decref( p_item );
if ( p_item ) input_item_Release( p_item );
}
void CoverArtLabel::setItem( input_item_t *_p_item )
{
if ( p_item ) vlc_gc_decref( p_item );
if ( p_item ) input_item_Release( p_item );
p_item = _p_item;
if ( p_item ) input_item_Hold( p_item );
}
......
......@@ -80,7 +80,7 @@ PLItem::PLItem( playlist_item_t * p_item )
PLItem::~PLItem()
{
vlc_gc_decref( p_input );
input_item_Release( p_input );
qDeleteAll( children );
children.clear();
}
......
......@@ -1084,7 +1084,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
PlMimeData::~PlMimeData()
{
foreach( input_item_t *p_item, _inputItems )
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
void PlMimeData::appendItem( input_item_t *p_item )
......
......@@ -171,7 +171,7 @@ PLSelector::~PLSelector()
{
QTreeWidgetItem *item = podcastsParent->child(i);
input_item_t *p_input = item->data( 0, IN_ITEM_ROLE ).value<input_item_t*>();
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
}
}
......@@ -546,7 +546,7 @@ void PLSelector::plItemRemoved( int id )
{
input_item_t *p_input = item->data( 0, IN_ITEM_ROLE ).value<input_item_t*>();
//msg_Dbg( p_intf, "Removing podcast: (%d) %s", id, p_input->psz_uri );
vlc_gc_decref( p_input );
input_item_Release( p_input );
delete item;
return;
}
......
......@@ -178,7 +178,7 @@ void EpgDialog::updateInfos()
if ( p_input_item )
{
epg->updateEPG( p_input_item );
vlc_gc_decref( p_input_item );
input_item_Release( p_input_item );
}
else
{
......
......@@ -87,7 +87,7 @@ public:
virtual ~IMEvent()
{
if( p_item )
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
input_item_t *item() const { return p_item; };
......
......@@ -52,7 +52,7 @@ public:
virtual ~CmdItemUpdate()
{
if( m_pItem )
vlc_gc_decref( m_pItem );
input_item_Release( m_pItem );
}
virtual void execute();
virtual std::string getType() const { return "playtree update"; }
......
......@@ -590,7 +590,7 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
vlc_InputItemMetaChanged,
inputItemMetaChanged,
p_ext );
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
vlc_object_release( old );
}
......@@ -669,7 +669,7 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
{
// Release item
input_item_t *p_item = input_GetItem( p_ext->p_sys->p_input );
vlc_gc_decref( p_item );
input_item_Release( p_item );
}
vlc_object_release( p_ext->p_sys->p_input );
p_ext->p_sys->p_input = NULL;
......
......@@ -262,7 +262,7 @@ static int vlclua_input_item_delete( lua_State *L )
return luaL_error( L, "script went completely foobar" );
*pp_item = NULL;
vlc_gc_decref( p_item );
input_item_Release( p_item );
return 1;
}
......
......@@ -301,7 +301,7 @@ static int vlclua_sd_add_item( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
while( i_options > 0 )
free( ppsz_options[--i_options] );
......@@ -397,7 +397,7 @@ static int vlclua_node_add_subitem( lua_State *L )
lua_setfield( L, -2, "__metatable" );
}
lua_setmetatable( L, -2 );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
while( i_options > 0 )
free( ppsz_options[--i_options] );
......
......@@ -581,7 +581,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
( b_play ? PLAYLIST_GO : 0 ),
true );
i_count ++; /* increment counter */
vlc_gc_decref( p_input );
input_item_Release( p_input );
while( i_options > 0 )
free( ppsz_options[--i_options] );
free( ppsz_options );
......
......@@ -206,7 +206,7 @@ static void resolve_callback(
vlc_dictionary_insert( &p_sys->services_name_to_input_item,
name, p_input );
services_discovery_AddItem( p_sd, p_input, NULL /* no category */ );
vlc_gc_decref( p_input );
input_item_Release( p_input );
}
}
......
......@@ -214,7 +214,7 @@ static void *Run( void *data )
vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
input_item_subitem_added, p_sd );
vlc_gc_decref( p_root );
input_item_Release( p_root );
free( psz_uri );
}
......@@ -303,7 +303,7 @@ static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
}
}
vlc_gc_decref( p_item );
input_item_Release( p_item );
free( psz_uri );
return VLC_SUCCESS;
......
......@@ -282,7 +282,7 @@ static void CloseDevice( services_discovery_t *p_sd )
if( pp_items[i_i] != NULL )
{
services_discovery_RemoveItem( p_sd, pp_items[i_i] );
vlc_gc_decref( pp_items[i_i] );
input_item_Release( pp_items[i_i] );
}
}
free( pp_items );
......
......@@ -197,7 +197,8 @@ static void Close( vlc_object_t *p_this )
free( p_sd->p_sys->pp_input );
for( i = 0; i < p_sys->i_urls; i++ ) free( p_sys->ppsz_urls[i] );
free( p_sys->ppsz_urls );
for( i = 0; i < p_sys->i_items; i++ ) vlc_gc_decref( p_sys->pp_items[i] );
for( i = 0; i < p_sys->i_items; i++ )
input_item_Release( p_sys->pp_items[i] );
free( p_sys->pp_items );
free( p_sys->psz_request );
free( p_sys );
......@@ -348,7 +349,7 @@ static void ParseUrls( services_discovery_t *p_sd, char *psz_urls )
if( j == i_new_items )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
vlc_gc_decref( p_sys->pp_items[i] );
input_item_Release( p_sys->pp_items[i] );
}
}
free( p_sys->pp_items );
......@@ -414,7 +415,7 @@ static void ParseRequest( services_discovery_t *p_sd )
if( i != p_sys->i_urls )
{
services_discovery_RemoveItem( p_sd, p_sys->pp_items[i] );
vlc_gc_decref( p_sys->pp_items[i] );
input_item_Release( p_sys->pp_items[i] );
REMOVE_ELEM( p_sys->ppsz_urls, p_sys->i_urls, i );
REMOVE_ELEM( p_sys->pp_items, p_sys->i_items, i );
}
......
......@@ -121,7 +121,7 @@ static void DestroySource (void *data)
struct device *d = data;
services_discovery_RemoveItem (d->sd, d->item);
vlc_gc_decref (d->item);
input_item_Release (d->item);