Commit bd054d30 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Remove services discovery tasks before the playlist

I assume nothing can ever try to add a new one once the interfaces have
been destroyed. If not there is a race condition.
parent bff9720d
......@@ -950,6 +950,10 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
}
#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 );
......
......@@ -247,6 +247,8 @@ static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
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)
/**
......
......@@ -419,12 +419,8 @@ void playlist_LastLoop( playlist_t *p_playlist )
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;
......
......@@ -430,3 +430,10 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
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 );
}
Supports Markdown
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