set_terminate doesn't work

ask:

I have a program which is terminating due to an unhandled C++ exception, but I don't know where. In order to find out, I added a call to set_terminate(), but it doesn't work. I am aware that the set_terminate() function will not work if the debugger is present, so I am testing my program outside the debugger, but it doesn't work.



answer:

Thanks for the report. I checked your simple case and confirmed (as you found) that set_terminate is working as expected.

If something else comes in and registers a terminate handler, then that handler wins. The last registered handler always wins.

Martyn Lovell
Development Lead
Visual C++ Libraries

你可能感兴趣的:(set_terminate doesn't work)