-/*****************************************************************************
- * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gtk+
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
- intf_thread_t *p_intf;
-
- int i_dummy;
-
- if( pp_global_data == NULL )
- {
- atexit( func );
- return;
- }
-
- p_intf = (intf_thread_t *)*pp_global_data;
- if( p_intf == NULL )
- {
- return;
- }
-
- for( i_dummy = 0;
- i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
- i_dummy++ )
- {
- ;
- }
-
- if( i_dummy >= MAX_ATEXIT - 1 )
- {
- msg_Err( p_intf, "too many atexit() callbacks to register" );
- return;
- }
-
- p_intf->p_sys->pf_callback[i_dummy] = func;
- p_intf->p_sys->pf_callback[i_dummy + 1] = NULL;
-}
-