[vlc-devel] commit: We may still have children when destroyed... ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 14 22:01:36 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May 14 23:02:48 2008 +0300| [5bfd7ba2d5743010ea14e1fc3afc6c36f3ba2adc]

We may still have children when destroyed...

...if the destructor destroys them properly.

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 9bfe39d..4c6547d 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -879,15 +879,9 @@ void __vlc_object_release( vlc_object_t *p_this )
         /* Detach from parent to protect against FIND_CHILDREN */
         if (p_this->p_parent)
             vlc_object_detach_unlocked (p_this);
-#ifndef NDEBUG
-        /* Detach from children to protect against FIND_PARENT.
-         * Destroying an object with children is currently not allowed anyway.
-         * This code is there only to ensure that the debugging code in
-         * vlc_object_destroy() will be invoked before a concurrent
-         * FIND_PARENT gets the chance to crash the process. */
+        /* Detach from children to protect against FIND_PARENT */
         for (int i = 0; i < p_this->i_children; i++)
             p_this->pp_children[i]->p_parent = NULL;
-#endif
     }
 
     vlc_mutex_unlock( &structure_lock );




More information about the vlc-devel mailing list