0

I have a simple question about objects and exception handling.

What happens to an object after its thrown? Does the implementation take of cleaning up that object or should I be aware of any situations that may require extra care...I've read this from - Inside The C++ Object Model by Stanley B. Lippman pg 261

"When an exception is thrown, the exception object is created and placed generally on some form of exception data stack"

This is great to know but I can't find any mention of what happens to that object after the exception is finished...Could someone please enlighten me...Thanks.

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by gerard4143
0

I can't find any mention of what happens to that object after the exception is finished

Finished by being caught and handled, or finished by being unhandled? In the former case, the destructor is properly called and the object ends after the final exception handler completes. In the latter case, abort is called, which is a hard terminate on the program.

Edited by Narue: n/a

0

Finished by being caught and handled, or finished by being unhandled? In the former case, the destructor is properly called and the object ends after the final exception handler completes. In the latter case, abort is called, which is a hard terminate on the program.

I meant the former and thank-you for clearing that up

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.