]> git.sesse.net Git - vlc/commitdiff
vlc_object_find*: don't check that refcount is zero
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 19:43:53 +0000 (22:43 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 19:43:53 +0000 (22:43 +0300)
Besides, we assert that this isn't the case right before...

src/misc/objects.c

index 64862e0f857d09a690ae86499ad534436651c295..675b2a31b0db74204e8534f79257af89e1646f26 100644 (file)
@@ -744,9 +744,10 @@ void * __vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
 
     vlc_mutex_lock( &structure_lock );
 
+    assert( vlc_internals( p_this )->i_refcount > 0 );
+
     /* If we are of the requested type ourselves, don't look further */
-    if( !(i_mode & FIND_STRICT) && p_this->i_object_type == i_type
-        && vlc_internals( p_this )->i_refcount > 0 )
+    if( !(i_mode & FIND_STRICT) && p_this->i_object_type == i_type )
     {
         vlc_object_yield_locked( p_this );
         vlc_mutex_unlock( &structure_lock );
@@ -802,8 +803,7 @@ void * __vlc_object_find_name( vlc_object_t *p_this, const char *psz_name,
     /* If have the requested name ourselves, don't look further */
     if( !(i_mode & FIND_STRICT)
         && p_this->psz_object_name
-        && !strcmp( p_this->psz_object_name, psz_name )
-        && vlc_internals( p_this )->i_refcount > 0 )
+        && !strcmp( p_this->psz_object_name, psz_name ) )
     {
         vlc_object_yield_locked( p_this );
         vlc_mutex_unlock( &structure_lock );