]> git.sesse.net Git - vlc/commitdiff
Don't check for 0 refcount.
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 19:46:37 +0000 (22:46 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 19:46:37 +0000 (22:46 +0300)
If it happens, there is a bug, and we'll assert in _yield.

src/misc/objects.c

index 675b2a31b0db74204e8534f79257af89e1646f26..4ec786b343ec2852aca9be0e8c8710d61a035a20 100644 (file)
@@ -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;