X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fplaylist%2Fservices_discovery.c;h=c7bc7eb06e0a495d06753b7b79e3d4665358d256;hb=dfc2996565842dbf644557debc80cb7cc8c2b4f4;hp=e3e787f9aa8683f46bf20c4edb3aaca0ff0c49f4;hpb=1b09c02c7e8162abb14d6f30980b09c7d7b34200;p=vlc diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c index e3e787f9aa..c7bc7eb06e 100644 --- a/src/playlist/services_discovery.c +++ b/src/playlist/services_discovery.c @@ -77,7 +77,7 @@ services_discovery_Create ( vlc_object_t * p_super, const char * psz_module_name if( p_sd->p_module == NULL ) { msg_Err( p_super, "no suitable services discovery module" ); - vlc_object_destroy( p_sd ); + vlc_object_release( p_sd ); return NULL; } p_sd->psz_module = strdup( psz_module_name ); @@ -98,7 +98,7 @@ void services_discovery_Destroy ( services_discovery_t * p_sd ) free( p_sd->psz_localized_name ); vlc_object_detach( p_sd ); - vlc_object_destroy( p_sd ); + vlc_object_release( p_sd ); } /*********************************************************************** @@ -111,7 +111,7 @@ int services_discovery_Start ( services_discovery_t * p_sd ) VLC_THREAD_PRIORITY_LOW, VLC_FALSE)) { msg_Err( p_sd, "cannot create services discovery thread" ); - vlc_object_destroy( p_sd ); + vlc_object_release( p_sd ); return VLC_EGENERIC; } return VLC_SUCCESS; @@ -143,7 +143,7 @@ services_discovery_GetLocalizedName ( services_discovery_t * p_sd ) void services_discovery_SetLocalizedName ( services_discovery_t * p_sd, const char *psz ) { - if(p_sd->psz_localized_name) free( p_sd->psz_localized_name ); + free( p_sd->psz_localized_name ); p_sd->psz_localized_name = strdup(psz); } @@ -234,8 +234,11 @@ static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_dat p_new_item = playlist_NodeAddInput( p_parent->p_playlist, p_input, p_parent, PLAYLIST_APPEND, PLAYLIST_END, VLC_FALSE ); - p_new_item->i_flags &= ~PLAYLIST_SKIP_FLAG; - p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG; + if( p_new_item ) + { + p_new_item->i_flags &= ~PLAYLIST_SKIP_FLAG; + p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG; + } } /* A new item has been removed from a certain sd */