Delphi Exception Handling - How to clean up properly?

前端 未结 4 1774
生来不讨喜
生来不讨喜 2021-01-04 20:22

I\'m looking at some code in an application of ours and came across something a little odd from what I normally do. With exception handling and cleanup, we (as well as many

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 20:31

    The finally and except will both trigger, the order is up to you. It depends on what you want to do in your finally or except block. Do you want to free something that is used in the except block? Place finally around the except block.

提交回复
热议问题