Is there a purpose for an empty Try / finally block?

I inherited a large code base that is full of such constructs:

              try
                 DoWhatever;
              finally
              end;

Sometimes "DoWhatever" includes some actions with controls, and very often this message is in the database, and in the code there are many cases when there is something in the finally block.

But I understand that if there is nothing in the finally block, then the whole attempt ... finally, the thing is pointless. The code is quite noisy, so I assume that it was just a placeholder for future code or a hold on the previous code. (There are many placeholders in the code.)

I understand that this is correct, or is there some kind of secret double bluff in Delphi try ... finally, the blocks that I forgot? (This is Delphi 2010.)

+4
source share
1

- . try, finally, , ( , finally), , try-finally hasn . , try-finally, .

, , try-finally, - . .

try-finally , , .

, , , , .

+4

Source: https://habr.com/ru/post/1688981/


All Articles