[vlc-devel] commit: services_discovery: Make sure we kill also object created by the input. (Pierre d'Herbemont )

git version control git at videolan.org
Tue Jul 22 20:34:50 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Jul 22 20:27:55 2008 +0200| [c05833cbb1e6d0578e283bf6e2eb1af3aeb6b861]

services_discovery: Make sure we kill also object created by the input.

This commit bother me. I don't see why we don't do it for all objects.

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

 src/playlist/services_discovery.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 17bf551..a4670e4 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -123,9 +123,21 @@ int services_discovery_Start ( services_discovery_t * p_sd )
 /***********************************************************************
  * Stop
  ***********************************************************************/
+static void ObjectKillChildrens( vlc_object_t *p_obj )
+{
+    vlc_list_t *p_list;
+    int i;
+    vlc_object_kill( p_obj );
+
+    p_list = vlc_list_children( p_obj );
+    for( i = 0; i < p_list->i_count; i++ )
+        ObjectKillChildrens( p_list->p_values[i].p_object );
+    vlc_list_release( p_list );
+}
+
 void services_discovery_Stop ( services_discovery_t * p_sd )
 {
-    vlc_object_kill( p_sd );
+    ObjectKillChildrens( p_sd );
     if( p_sd->pf_run ) vlc_thread_join( p_sd );
 
     module_Unneed( p_sd, p_sd->p_module );




More information about the vlc-devel mailing list