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 );
/* 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 );