std :: string析构函数中的奇怪错误

时间:2012-06-01 15:36:16

标签: c++ debugging stdstring application-verifier

我在Application Verifier下运行了我的应用程序,它在我的应用关闭时向我显示了以下问题:

VERIFIER STOP 00000210: pid 0x6D0: Critical section not initialized. 

    005C9148 : Critical section address.
    00000000 : Critical section debug info address.
    00000000 : Not used.
    00000000 : Not used.

堆栈跟踪:

myapp!_Mtxlock+0xf [f:\dd\vctools\crt_bld\self_x86\crt\src\xmtx.c @ 45]
myapp!std::_Lockit::_Lockit+0x2d [f:\dd\vctools\crt_bld\self_x86\crt\src\xlock.cpp @ 64]
myapp!std::_Container_base12::_Orphan_all+0x2f [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility @ 200]
myapp!std::_String_val<wchar_t,std::allocator<wchar_t> >::~_String_val<wchar_t,std::allocator<wchar_t> >+0x57 [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring @ 479]
myapp!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >+0x4f [c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring @ 755]
myapp!MyClass::~MyClass+0x42
myapp!MyOtherClass::~MyOtherClass+0x5f
myapp!MyOtherClass::`scalar deleting destructor'+0x16
myapp!MyComInterfaceImplementation::Release+0x54
mscorwks!DllRegisterServerInternal+0x213f6
mscorwks!DllRegisterServerInternal+0x214ac
mscorwks!DllRegisterServerInternal+0x21510
mscorwks!StrongNameErrorInfo+0x6565
mscorwks!StrongNameErrorInfo+0x632c
mscorwks!StrongNameErrorInfo+0x64ad
mscorwks!LogHelp_LogAssert+0x4ee01
mscorwks!LogHelp_LogAssert+0x4f269
mscorwks!LogHelp_LogAssert+0x4f334
mscorwks!CorDllMain+0x1ca6
mscorwks!CorDllMain+0x230e
mscorwks!CreateApplicationContext+0xe551
mscorwks!DllRegisterServerInternal+0x2eacd
vfbasics+0x1602c
kernel32!GetModuleHandleA+0xdf

注意std :: basic_string的析构函数出错了。 可能是什么原因造成的?

1 个答案:

答案 0 :(得分:2)

您的MyClass可能已在运行时被销毁一次,并且在关机时再次被销毁,标记了一个轻微的虚假错误消息。