[vlc-devel] commit: vlc_object_find*: don't check that refcount is zero ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed May 7 21:45:21 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May 7 22:43:53 2008 +0300| [4ec615d89a46281055b35bdd5a2bc7935b6ae0d8]
vlc_object_find*: don't check that refcount is zero
Besides, we assert that this isn't the case right before...
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ec615d89a46281055b35bdd5a2bc7935b6ae0d8
---
src/misc/objects.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 64862e0..675b2a3 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -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 );
More information about the vlc-devel
mailing list