SEH problem between debug and release version
-
hi! several days ago,I wrote my program with seh filter function using "_set_se_translator()",the debug version worked well as my expectation that it turned to my own exception filter specified in _set_se_translator() when the exception happened;but the release version did it as if there was no try_catch statement.why? thanks!
-
hi! several days ago,I wrote my program with seh filter function using "_set_se_translator()",the debug version worked well as my expectation that it turned to my own exception filter specified in _set_se_translator() when the exception happened;but the release version did it as if there was no try_catch statement.why? thanks!
You need to provide a bit more context about your code. That said, I ran into something similar which may be the problem you're having. I had code similar to this:
int* pi = NULL; int i = *pi; // Generates an access violation
In debug builds, an exception was thrown from my SE handler and caught, but not in release builds. As it turned out, in release builds, the optimiser was correctly removing this code because it had no effect. :doh: Not sure what you're doing, but if it's simple test case like mine, you might want to turn off the optimiser for that block of code:#pragma optimize("", off)
Brad