*/
/* Object types */
-#define VLC_OBJECT_GLOBAL (-1)
+
#define VLC_OBJECT_LIBVLC (-2)
#define VLC_OBJECT_MODULE (-3)
#define VLC_OBJECT_INTF (-4)
int i_type;
const char *psz_name;
} pp_objects[] =
- { { VLC_OBJECT_GLOBAL, "global" },
- { VLC_OBJECT_LIBVLC, "libvlc" },
+ { { VLC_OBJECT_LIBVLC, "libvlc" },
{ VLC_OBJECT_MODULE, "module" },
{ VLC_OBJECT_INTF, "intf" },
{ VLC_OBJECT_PLAYLIST, "playlist" },
}
libvlc_global_data_t *p_libvlc_global;
- if( i_type == VLC_OBJECT_GLOBAL )
+ if( p_this == NULL )
{
- /* If i_type is global, then p_new is actually p_libvlc_global */
+ /* Only the global root object is created out of the blue */
p_libvlc_global = (libvlc_global_data_t *)p_new;
p_new->p_libvlc = NULL;
free( p_this->psz_header );
- if( p_this->i_object_type == VLC_OBJECT_GLOBAL )
+ if( p_this->p_libvlc == NULL )
{
libvlc_global_data_t *p_global = (libvlc_global_data_t *)p_this;
+#ifndef NDEBUG
+ assert( p_global == vlc_global() );
/* Test for leaks */
if( p_global->i_objects > 0 )
{
/* Strongly abort, cause we want these to be fixed */
abort();
}
+#endif
/* We are the global object ... no need to lock. */
free( p_global->pp_objects );
if( i_initializations == 0 )
{
p_root = vlc_custom_create( NULL, sizeof( *p_root ),
- VLC_OBJECT_GLOBAL, "global" );
+ VLC_OBJECT_GENERIC, "root" );
if( p_root == NULL )
{
i_ret = VLC_ENOMEM;