Explanation

Calling onCleanup(@functionhandle) without an output argument can lead to unexpected behavior that is difficult to debug.


Suggested Action

Assign onCleanup(@functionhandle) to a variable. For more information, see “Clean Up When Functions Complete”.