A CeePlusPlus idiom.
Rule to prefer cleaning things up in (deterministic) destructors instead of 'finally' blocks or just loose at the end of functions.
This is absolutely necessary in C++ to make code exception safe.
See also InitializationIsResourceAcquisition, ResourceAcquisitionIsInitialization, ResourceAcquisitionIsInvocation