[vlc-devel] commit: Make vlc_object_detach a no-op if the object is not attached ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri May 16 18:06:19 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Fri May 16 19:06:25 2008 +0300| [00e3e4101653be55e430b35d6fcb8d5b86df269d]

Make vlc_object_detach a no-op if the object is not attached

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

 src/misc/objects.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index b903e65..4afc08c 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -918,7 +918,10 @@ void __vlc_object_attach( vlc_object_t *p_this, vlc_object_t *p_parent )
 
 static void vlc_object_detach_unlocked (vlc_object_t *p_this)
 {
-    assert (p_this->p_parent);
+    vlc_assert_locked (&structure_lock);
+
+    if (p_this->p_parent == NULL)
+        return;
 
     vlc_object_internals_t *priv = vlc_internals( p_this->p_parent );
 




More information about the vlc-devel mailing list