Example #1
0
tb_void_t xm_exit()
{
    // need exit?
    tb_long_t init = 0;
    if ((init = tb_atomic_dec_and_fetch(&g_init)) > 0) return ;

    // check
    tb_assert_and_check_return(!init);

    // exit tbox
    tb_exit();
}
Example #2
0
tb_void_t tb_exit()
{
    // need exit?
    tb_long_t init = 0;
    if ((init = tb_atomic_dec_and_fetch(&g_init)) > 0) return ;

    // check
    tb_assert_and_check_return(!init);
    
    // kill singleton
    tb_singleton_kill();

    // exit object
#ifdef TB_CONFIG_MODULE_HAVE_OBJECT
    tb_object_context_exit();
#endif
    
    // exit network
    tb_network_exit();
     
    // exit libm
    tb_libm_exit();
     
    // exit math
    tb_math_exit();
    
    // exit libc
    tb_libc_exit();
    
    // exit platform
    tb_platform_exit();
    
    // exit singleton
    tb_singleton_exit();

    // exit memory
    tb_memory_exit();

    // trace
    tb_trace_d("exit: ok");

    // exit trace
    tb_trace_exit();
}