If the power is lost (for example, if you disconnected the computer and it does not have a battery and is not connected to the UPS), it is very possible that the finally block will not start. A serious malfunction of the OS or drivers (for example, BSOD) can also occur. However, the whole idea with the try..finally construct is that the finally block must be executed, even if an exception (of any kind) is thrown in the try block. The finally block will work even if there is an exit try in the try block.
source share