[vlc-devel] commit: Don't check for 0 refcount. ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 7 21:45:22 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May  7 22:46:37 2008 +0300| [6c385c5033ed68053d3ca1f66bfab28fcc981b98]

Don't check for 0 refcount.

If it happens, there is a bug, and we'll assert in _yield.

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

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

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 675b2a3..4ec786b 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -1297,8 +1297,7 @@ static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode )
         p_tmp = p_this->p_parent;
         if( p_tmp )
         {
-            if( p_tmp->i_object_type == i_type
-                && vlc_internals( p_tmp )->i_refcount > 0 )
+            if( p_tmp->i_object_type == i_type )
             {
                 vlc_object_yield_locked( p_tmp );
                 return p_tmp;
@@ -1314,8 +1313,7 @@ static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode )
         for( i = p_this->i_children; i--; )
         {
             p_tmp = p_this->pp_children[i];
-            if( p_tmp->i_object_type == i_type
-                && vlc_internals( p_tmp )->i_refcount > 0 )
+            if( p_tmp->i_object_type == i_type )
             {
                 vlc_object_yield_locked( p_tmp );
                 return p_tmp;
@@ -1353,8 +1351,7 @@ static vlc_object_t * FindObjectName( vlc_object_t *p_this,
         if( p_tmp )
         {
             if( p_tmp->psz_object_name
-                && !strcmp( p_tmp->psz_object_name, psz_name )
-                && vlc_internals( p_tmp )->i_refcount > 0 )
+                && !strcmp( p_tmp->psz_object_name, psz_name ) )
             {
                 vlc_object_yield_locked( p_tmp );
                 return p_tmp;
@@ -1371,8 +1368,7 @@ static vlc_object_t * FindObjectName( vlc_object_t *p_this,
         {
             p_tmp = p_this->pp_children[i];
             if( p_tmp->psz_object_name
-                && !strcmp( p_tmp->psz_object_name, psz_name )
-                && vlc_internals( p_tmp )->i_refcount > 0 )
+                && !strcmp( p_tmp->psz_object_name, psz_name ) )
             {
                 vlc_object_yield_locked( p_tmp );
                 return p_tmp;




More information about the vlc-devel mailing list