Destructors can and often perform other operations than freeing up memory and / or resources. They are often used to ensure that some other guarantees, such as user data, are written to a file or non-process related resources are in a known state. The OS will not perform these operations upon exit.
Thus, any program that relies on these types of actions is fundamentally wrong. Using exit and interrupt is not the only way to avoid destructors. There are many other ways a destructor can get around. For example, the user can turn off the process or turn off the power.
I definitely disagree with what is never quoted in the quote. I can imagine at least one situation where you absolutely do not want destructors to execute: corrupted memory. The moment you discover corrupted memory, you can no longer make any guarantees regarding the code in your process, including destructors. Code that should write data to a file can delete / ruin it.
The only safe thing to do when memory corruption is detected is to exit the process as quickly as possible.
source share