From: RĂ©mi Denis-Courmont Date: Tue, 19 Aug 2008 15:22:12 +0000 (+0300) Subject: libvlccore: the object counter is specific so misc/objects.c X-Git-Tag: 0.9.0~213 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e1f1b1e2e69cde5937ed22465ebd29dfd4510b5e;p=vlc libvlccore: the object counter is specific so misc/objects.c --- diff --git a/src/libvlc.h b/src/libvlc.h index 334b74442e..dfcaecf331 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -154,9 +154,6 @@ typedef struct libvlc_global_data_t { VLC_COMMON_MEMBERS - /* Object structure data */ - int i_counter; ///< object counter - module_bank_t * p_module_bank; ///< The module bank char * psz_vlcpath; diff --git a/src/misc/objects.c b/src/misc/objects.c index 96214c14d0..b7ed1e63bf 100644 --- a/src/misc/objects.c +++ b/src/misc/objects.c @@ -94,7 +94,8 @@ static void held_objects_destroy (void *); /***************************************************************************** * Local structure lock *****************************************************************************/ -static vlc_mutex_t structure_lock; +static vlc_mutex_t structure_lock; +static unsigned object_counter = 0; void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size, int i_type, const char *psz_type ) @@ -148,7 +149,7 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size, p_libvlc_global = (libvlc_global_data_t *)p_new; p_new->p_libvlc = NULL; - p_libvlc_global->i_counter = 0; + object_counter = 0; /* reset */ p_priv->next = p_priv->prev = p_new; vlc_mutex_init( &structure_lock ); #ifdef LIBVLC_REFCHECK @@ -194,7 +195,7 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size, p_priv->prev = vlc_internals (p_libvlc_global)->prev; vlc_internals (p_libvlc_global)->prev = p_new; vlc_internals (p_priv->prev)->next = p_new; - p_new->i_object_id = p_libvlc_global->i_counter++; + p_new->i_object_id = object_counter++; /* fetch THEN increment */ vlc_mutex_unlock( &structure_lock ); if( i_type == VLC_OBJECT_LIBVLC )