I assume nothing can ever try to add a new one once the interfaces have
been destroyed. If not there is a race condition.
}
#endif
+ /* Remove all services discovery */
+ msg_Dbg( p_libvlc, "removing all services discovery tasks" );
+ playlist_ServicesDiscoveryKillAll( priv->p_playlist );
+
/* Free playlist */
msg_Dbg( p_libvlc, "removing playlist" );
vlc_object_release( priv->p_playlist );
return (libvlc_priv_t *)(libvlc + 1);
}
+void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
+
#define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
/**
sout_DeleteInstance( p_sout );
#endif
- while( p_playlist->i_sds )
- {
- playlist_ServicesDiscoveryRemove( p_playlist,
- p_playlist->pp_sds[0]->p_sd->psz_module );
- }
-
+ /* Core should have terminated all SDs before the playlist */
+ assert( p_playlist->i_sds == 0 );
playlist_MLDump( p_playlist );
PL_LOCK;
return false;
}
+void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist )
+{
+ while( p_playlist->i_sds > 0 )
+ playlist_ServicesDiscoveryRemove( p_playlist,
+ p_playlist->pp_sds[0]->p_sd->psz_module );
+}
+