[vlc-devel] commit: Playlist: detach from SD events _after_ stopping the plugin ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 10 19:10:12 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 10 19:48:37 2009 +0200| [74db29fdba037475a080b134cd30383ad7817a18] | committer: Rémi Denis-Courmont 

Playlist: detach from SD events _after_ stopping the plugin

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=74db29fdba037475a080b134cd30383ad7817a18
---

 src/playlist/services_discovery.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 406f5ff..e88d9b8 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -336,28 +336,33 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
     }
     PL_UNLOCK;
 
-    if( !p_sds || !p_sds->p_sd )
+    if( !p_sds )
     {
         msg_Warn( p_playlist, "module %s is not loaded", psz_module );
         return VLC_EGENERIC;
     }
 
-    vlc_event_detach( services_discovery_EventManager( p_sds->p_sd ),
+    services_discovery_t *p_sd = p_sds->p_sd;
+    assert( p_sd );
+
+    vlc_sd_Stop( p_sd );
+
+    vlc_event_detach( services_discovery_EventManager( p_sd ),
                         vlc_ServicesDiscoveryItemAdded,
                         playlist_sd_item_added,
                         p_sds->p_one );
 
-    vlc_event_detach( services_discovery_EventManager( p_sds->p_sd ),
+    vlc_event_detach( services_discovery_EventManager( p_sd ),
                         vlc_ServicesDiscoveryItemAdded,
                         playlist_sd_item_added,
                         p_sds->p_cat );
 
-    vlc_event_detach( services_discovery_EventManager( p_sds->p_sd ),
+    vlc_event_detach( services_discovery_EventManager( p_sd ),
                         vlc_ServicesDiscoveryItemRemoved,
                         playlist_sd_item_removed,
                         p_sds->p_one );
 
-    vlc_event_detach( services_discovery_EventManager( p_sds->p_sd ),
+    vlc_event_detach( services_discovery_EventManager( p_sd ),
                         vlc_ServicesDiscoveryItemRemoved,
                         playlist_sd_item_removed,
                         p_sds->p_cat );
@@ -372,7 +377,7 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
     }
     PL_UNLOCK;
 
-    vlc_sd_StopAndDestroy( p_sds->p_sd );
+    vlc_sd_Destroy( p_sd );
     free( p_sds );
 
     return VLC_SUCCESS;




More information about the vlc-devel mailing list