Under what circumstances are C++ destructors not going to be called?

前端 未结 8 852
-上瘾入骨i
-上瘾入骨i 2020-12-02 08:52

I know that my destructors are called on normal unwind of stack and when exceptions are thrown, but not when exit() is called.

Are there any other cases where my des

8条回答
  •  [愿得一人]
    2020-12-02 09:41

    Another case they won't be called is if you are using polymorphism and have not made your base destructors virtual.

提交回复
热议问题