Calling
onCleanup(@functionhandle)
without an output argument can lead to unexpected behavior that is difficult to
debug.
Assign
onCleanup(@functionhandle)
to
a variable. For more information, see “Clean Up When Functions Complete”.