VirtualBox

忽略:
時間撮記:
2009-7-30 下午02:22:17 (15 年 以前)
作者:
vboxsync
訊息:

r3/init.cpp: Use an atexit callback to flush the default logs.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r3/init.cpp

    r20911 r21890  
    124124
    125125
     126/**
     127 * atexit callback.
     128 *
     129 * This makes sure any loggers are flushed and will later also work the
     130 * termination callback chain.
     131 */
     132static void rtR3ExitCallback(void)
     133{
     134    if (g_cUsers > 0)
     135    {
     136        PRTLOGGER pLogger = RTLogGetDefaultInstance();
     137        if (pLogger)
     138            RTLogFlush(pLogger);
     139
     140        pLogger = RTLogRelDefaultInstance();
     141        if (pLogger)
     142            RTLogFlush(pLogger);
     143    }
     144}
     145
    126146
    127147#ifndef RT_OS_WINDOWS
     
    269289    setlocale(LC_CTYPE, "");
    270290
    271     /* Fork callbacks. */
     291    /* Fork and exit callbacks. */
    272292#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
    273293    rc = pthread_atfork(NULL, NULL, rtR3ForkChildCallback);
    274294    AssertMsg(rc == 0, ("%d\n", rc));
    275295#endif
     296    atexit(rtR3ExitCallback);
    276297
    277298#ifdef IPRT_WITH_ALIGNMENT_CHECKS
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette