In C++11 or later, we can call std::quick_exit
to exit a process without any unwinding, that is, no destructor will be called [after | during] std::quick_exit
.
I have a project:
- It has a global object, and there is a fatal bug in the destructor of the global object;
- I have no access to the source of the global object;
- If I can call
std::quick_exit
at the last line ofmain
function, the bug won't be triggered; - For some reason, the project must be compiled with a C++98 compiler; that is to say, I cannot call
std::quick_exit
in a C++98 compiler.
In short:
What function in C++98 is equivalent to C++11's std::quick_exit
?
Under Windows, I can call ExitProcess(0)
to forcibly exit a process without any cleanup.
What's the counterpart under Linux?
Aucun commentaire:
Enregistrer un commentaire