Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
243 - Return from a finally-block halts global unwind.
Consequence: The exception will not be propagated.
This warning indicates that a return statement was detected in the handler of a try/finally statement.
A try/finally statement is intended to allow guaranteed cleanup, not exception handling, but returning from the finally block will handle an exception if one occurred.
Example
Defective Source
__try {
;
} __finally {
if (rand()) {
return 2;
}
}
Corrected Source
int RetVal;
__try {
;
} __finally {
if (rand()) {
RetVal = 2;
}
}
return RetVal;
Send Feedback on this topic to the authors