I don't know for sure, so I may be wrong.
But afaik, each "try..." creates an exception frame. So if you nest two of them, it's double the work.
No idea if the c construct does it with one?
But for what you want to do, you don't need to nest two try blocks
try
Allocate();
Something();
except
DoHandleException;
end;
// you handled the exception, so you will always be here
// unless you gor an exception while handling the exception
DeAllocate();
if you think handling the exception may fail itself
except
try
DoHandleException;
except
// do nothing on 2nd exception, so never fail here
end;
end;
This code has 2 exception frames, but the 2nd will only be created, if there is an exception, so normally doesn't matter.
If you want to reraise the exception
LastExcept := nil;
try
Allocate();
Something();
except
On e: exception do begin
DoHandleException;
LastExcept := e;
end;
end;
DeAllocate();
if e <> nil then raise e;