]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
* include/vlc_common.h: free tab if empty in TAB_REMOVE().
[vlc] / include / vlc_common.h
index f58dd3aa6967abeb872878020eb040f3c75aa480..ce07045d892c1ff856c8412c81e8f92c5ff8c16b 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.111 2004/03/03 13:25:00 fenrir Exp $
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -506,12 +506,12 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
                          ((void**)(tab) + _i_index_+1),  \
                          ( (count) - _i_index_ - 1 ) * sizeof( void* ) );\
             }                                   \
-            else                                \
+            (count)--;                          \
+            if( (count) == 0 )                  \
             {                                   \
                 free( tab );                    \
                 (tab) = NULL;                   \
             }                                   \
-            (count)--;                          \
         }                                       \
     }