/*****************************************************************************
* The evil global variables. We handle them with care, don't worry.
*****************************************************************************/
-static unsigned i_instances = 0;
#ifndef WIN32
static bool b_daemon = false;
#endif
static int ConsoleWidth ( void );
-static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
extern const char psz_vlc_changeset[];
/**
/* Now that the thread system is initialized, we don't have much, but
* at least we have variables */
- vlc_mutex_lock( &global_lock );
- if( i_instances == 0 )
- {
- /* The module bank will be initialized later */
- }
-
/* Allocate a libvlc instance object */
p_libvlc = vlc_custom_create( (vlc_object_t *)NULL, sizeof (*priv),
"libvlc" );
- if( p_libvlc != NULL )
- i_instances++;
- vlc_mutex_unlock( &global_lock );
-
if( p_libvlc == NULL )
return NULL;
{
libvlc_priv_t *priv = libvlc_priv( p_libvlc );
- vlc_mutex_lock( &global_lock );
- i_instances--;
-
- if( i_instances == 0 )
- {
- /* System specific cleaning code */
- system_End( );
- }
- vlc_mutex_unlock( &global_lock );
+ system_End( );
/* Destroy mutexes */
vlc_ExitDestroy( &priv->exit );