[vlc-devel] commit: Simplification ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri May 16 18:12:13 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Fri May 16 19:13:37 2008 +0300| [70ad10b0c4caa43776ec0f79271f1bae34310cde]

Simplification

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

 src/misc/objects.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 4afc08c..29a3bd2 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -877,8 +877,7 @@ void __vlc_object_release( vlc_object_t *p_this )
                      p_libvlc_global->i_objects, i_index );
 
         /* Detach from parent to protect against FIND_CHILDREN */
-        if (p_this->p_parent)
-            vlc_object_detach_unlocked (p_this);
+        vlc_object_detach_unlocked (p_this);
         /* Detach from children to protect against FIND_PARENT */
         for (int i = 0; i < internals->i_children; i++)
             internals->pp_children[i]->p_parent = NULL;
@@ -966,15 +965,10 @@ void __vlc_object_detach( vlc_object_t *p_this )
     if( !p_this ) return;
 
     vlc_mutex_lock( &structure_lock );
-
     if( !p_this->p_parent )
-    {
         msg_Err( p_this, "object is not attached" );
-        vlc_mutex_unlock( &structure_lock );
-        return;
-    }
-
-    vlc_object_detach_unlocked( p_this );
+    else
+        vlc_object_detach_unlocked( p_this );
     vlc_mutex_unlock( &structure_lock );
 }
 




More information about the vlc-devel mailing list