我剛開始用log4cxx做一個小應用來熟悉它。我用Visual Studio 2005編譯,沒有警告或錯誤。 基本上看起來像:log4cxx在〜Logger上拋出異常
#includes<...>
...
...
LoggerPtr logger(Logger::getLogger("MyApp"));
void main(...)
{
//some logs here
}
它按預期工作,直到我關閉應用程序時,我得到一個異常,而試圖破壞全球記錄儀對象。 這裏是跟蹤:
log4cxx.dll!apr_pool_cleanup_kill(apr_pool_t * p=0xdddddddd, const void * data=0x01cf6158, int (void *)* cleanup_fn=0x10174250) Line 1981 + 0x3 bytes
log4cxx.dll!apr_pool_cleanup_run(apr_pool_t * p=0xdddddddd, void * data=0x01cf6158, int (void *)* cleanup_fn=0x10174250) Line 2025
log4cxx.dll!apr_thread_mutex_destroy(apr_thread_mutex_t * mutex=0x01cf6158) Line 133
log4cxx.dll!log4cxx::helpers::Mutex::~Mutex() Line 57
log4cxx.dll!log4cxx::Logger::~Logger() Line 55 + 0xb bytes
log4cxx.dll!log4cxx::Logger::`vbase destructor'() + 0x19 bytes
log4cxx.dll!log4cxx::Logger::`vector deleting destructor'() + 0x5a bytes
log4cxx.dll!log4cxx::helpers::ObjectImpl::releaseRef() Line 46 + 0x39 bytes
log4cxx.dll!log4cxx::Logger::releaseRef() Line 63
log4cxx.dll!log4cxx::helpers::ObjectPtrT<log4cxx::Logger>::~ObjectPtrT<log4cxx::Logger>() Line 100 + 0x33 bytes
NodeBHeartBeat.exe!`dynamic atexit destructor for 'logger''() + 0x2b bytes
msvcr80d.dll!doexit(int code=0x00000000, int quick=0x00000000, int retcaller=0x00000001) Line 553
msvcr80d.dll!_cexit() Line 413 + 0xb bytes
msvcr80d.dll!__CRTDLL_INIT(void * hDllHandle=0x6c710000, unsigned long dwReason=0x00000000, void * lpreserved=0x00000001) Line 389
msvcr80d.dll!_CRTDLL_INIT(void * hDllHandle=0x6c710000, unsigned long dwReason=0x00000000, void * lpreserved=0x00000001) Line 214 + 0x11 bytes
ntdll.dll!774b9960()
任何人有任何想法,爲什麼會出現這種情況? 感謝