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

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 ) ...@@ -950,6 +950,10 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
} }
#endif #endif
/* Remove all services discovery */
msg_Dbg( p_libvlc, "removing all services discovery tasks" );
playlist_ServicesDiscoveryKillAll( priv->p_playlist );
/* Free playlist */ /* Free playlist */
msg_Dbg( p_libvlc, "removing playlist" ); msg_Dbg( p_libvlc, "removing playlist" );
vlc_object_release( priv->p_playlist ); vlc_object_release( priv->p_playlist );
......
...@@ -247,6 +247,8 @@ static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc) ...@@ -247,6 +247,8 @@ static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
return (libvlc_priv_t *)(libvlc + 1); 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) #define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
/** /**
......
...@@ -419,12 +419,8 @@ void playlist_LastLoop( playlist_t *p_playlist ) ...@@ -419,12 +419,8 @@ void playlist_LastLoop( playlist_t *p_playlist )
sout_DeleteInstance( p_sout ); sout_DeleteInstance( p_sout );
#endif #endif
while( p_playlist->i_sds ) /* Core should have terminated all SDs before the playlist */
{ assert( p_playlist->i_sds == 0 );
playlist_ServicesDiscoveryRemove( p_playlist,
p_playlist->pp_sds[0]->p_sd->psz_module );
}
playlist_MLDump( p_playlist ); playlist_MLDump( p_playlist );
PL_LOCK; PL_LOCK;
......
...@@ -430,3 +430,10 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist, ...@@ -430,3 +430,10 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
return false; 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 );
}
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