[vlc-commits] tdestroy: use assert()

Rémi Denis-Courmont git at videolan.org
Tue Jan 31 22:17:42 CET 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jan 31 18:59:36 2012 +0200| [bb54273e8ff796b20130617e07f07249d4ba77dd] | committer: Jean-Baptiste Kempf

tdestroy: use assert()
(cherry picked from commit 2b268061a42125e7ce79d63e42ce0cc2dd9c720c)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/extras/tdestroy.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/extras/tdestroy.c b/src/extras/tdestroy.c
index 9d3deab..ea199b8 100644
--- a/src/extras/tdestroy.c
+++ b/src/extras/tdestroy.c
@@ -93,9 +93,11 @@ void vlc_tdestroy (void *root, void (*freenode) (void *))
     vlc_mutex_lock (&smallest.lock);
     for (size_t i = 0; i < count; i++)
     {
-         smallest.node = tab[i];
-         if (tdelete (smallest.node, &root, cmp_smallest) == NULL)
-             abort ();
+         void *node  = tab[i];
+
+         smallest.node = node;
+         node = tdelete (node, &root, cmp_smallest);
+         assert (node != NULL);
     }
     vlc_mutex_unlock (&smallest.lock);
     assert (root == NULL);



More information about the vlc-commits mailing list