Mixed-mode C++/CLI app not shutting down CLR correctly
问题 My mixed-mode MFC application is creating false memory leaks because the CRT doesn't have time to shut down before the MFC dll is shut down. I have a very simple little app that shows the problem: #include <windows.h> #include <iostream> struct LongTimeToDestroy { ~LongTimeToDestroy() { std::cout << "Will get called!" << std::endl; Sleep(3000); std::cout << "Won't get called!" << std::endl; } }; LongTimeToDestroy gJamsUpTheCRT; int main() { } Compile with cl.exe /clr test.cpp . When run, you