From e1f1b1e2e69cde5937ed22465ebd29dfd4510b5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 19 Aug 2008 18:22:12 +0300 Subject: [PATCH] libvlccore: the object counter is specific so misc/objects.c --- src/libvlc.h | 3 --- src/misc/objects.c | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) 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 ) -- 2.39.2