 Resource leaks may happen under regular program flow – such as simply forgetting to release a resource – or only in exceptional circumstances, such as when a resource is not released if there is an exception in another part of the program.Resource leaks are very frequently caused by early exit from a subroutine, either by a codice_1 statement, or an exception raised either by the subroutine itself, or a deeper subroutine that it calls.While resource release due to return statements can be handled by carefully releasing within the subroutine before the return, exceptions cannot be handled without some additional language facility that guarantees that release code is executed.