- When exiting, set the flag "in_exit_cleanup".