Commit 25b8641d authored by Rafaël Carré's avatar Rafaël Carré
Browse files

Fix input item leaking

parent 1b069355
...@@ -1431,9 +1431,11 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1431,9 +1431,11 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
if( p_item ) if( p_item )
{ {
msg_rc( "Trying to add %s to playlist.", newval.psz_string ); msg_rc( "Trying to add %s to playlist.", newval.psz_string );
if( playlist_AddInput( p_playlist, p_item, int i_ret =playlist_AddInput( p_playlist, p_item,
PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END, true, PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END, true,
false ) != VLC_SUCCESS ) false );
vlc_gc_decref( p_item );
if( i_ret != VLC_SUCCESS )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -1290,6 +1290,7 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y, ...@@ -1290,6 +1290,7 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
psz_utf8, psz_utf8 ); psz_utf8, psz_utf8 );
int i_ret = ( playlist_NodeAddInput( p->p_playlist, p_input, p_dest, int i_ret = ( playlist_NodeAddInput( p->p_playlist, p_input, p_dest,
PLAYLIST_PREPARSE, i_pos, false ) != VLC_SUCCESS ); PLAYLIST_PREPARSE, i_pos, false ) != VLC_SUCCESS );
vlc_gc_decref( p_input );
wxDnDLocaleFree( psz_utf8 ); wxDnDLocaleFree( psz_utf8 );
if( i_ret != VLC_SUCCESS ) if( i_ret != VLC_SUCCESS )
return FALSE; return FALSE;
......
...@@ -1635,6 +1635,7 @@ void WizardDialog::Run() ...@@ -1635,6 +1635,7 @@ void WizardDialog::Run()
/* FIXME: playlist_AddInput() can fail */ /* FIXME: playlist_AddInput() can fail */
playlist_AddInput( p_playlist, p_input, playlist_AddInput( p_playlist, p_input,
PLAYLIST_GO, PLAYLIST_END, true, false ); PLAYLIST_GO, PLAYLIST_END, true, false );
vlc_gc_decref( p_input );
vlc_object_release(p_playlist); vlc_object_release(p_playlist);
} }
else else
......
...@@ -221,6 +221,7 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node ) ...@@ -221,6 +221,7 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node )
playlist_BothAddInput( p_playlist, p_input, p_parent, playlist_BothAddInput( p_playlist, p_input, p_parent,
PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL, PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL,
false ); false );
vlc_gc_decref( p_input );
} else if ( node->isContainerNode() ) } else if ( node->isContainerNode() )
{ {
ContainerNode *conNode = (ContainerNode *)node; ContainerNode *conNode = (ContainerNode *)node;
......
...@@ -875,6 +875,7 @@ void MediaServer::_buildPlaylist( Container* parent ) ...@@ -875,6 +875,7 @@ void MediaServer::_buildPlaylist( Container* parent )
playlist_BothAddInput( p_playlist, p_input, parentNode, playlist_BothAddInput( p_playlist, p_input, parentNode,
PLAYLIST_APPEND, PLAYLIST_END, &i_cat, NULL, PLAYLIST_APPEND, PLAYLIST_END, &i_cat, NULL,
false ); false );
vlc_gc_decref( p_input );
/* TODO: do this better by storing ids */ /* TODO: do this better by storing ids */
playlist_item_t *p_node = playlist_ItemGetById( p_playlist, i_cat, false ); playlist_item_t *p_node = playlist_ItemGetById( p_playlist, i_cat, false );
assert( p_node ); assert( p_node );
......
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