My Win32 console applaton uses a third-party library. After it exits WinMain, global objects are destroyed, and AV happens somewhere deep inside. I really want to just write
TerminateProcess( GetCurrentProcess(), 0 );
somewhere near the end of WinMain. If I do this, the application will end gracefully.
But MSDN says this could compromise the state of global data supported by dynamic link libraries (DLLs) that are not clear. I understand that if I have a global object, its destructor does not start, and I risk not modifying the database connection or something like that. There is nothing like this in my program.
What exactly is the risk of using TerminateProcess? How to determine if I can use it for my purposes?
source
share