I ran my application under Application Verifier and it showed me the following problem on my app's shutdown:
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.
The stack trace:
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
Note something went wrong in std::basic_string's destructor. What may be the cause of this?
Your
MyClass
was probably already destroyed once during runtime and it's getting destroyed again at shutdown, flagging a slightly bogus error message.