The exiting library provides a way to perform cleanup actions when the application is quit.
Clean up actions can be installed by registering a callback procedure that will be invoked by exit:exit.
On exit, callback will be called with no arguments.
Also, use exit:insert-on-callback:
(exit:insert-on-callback callback)
to perform cleanup actions.
Also, callbacks can be registered that abort exiting. To install such a
a callback, use exit:insert-can?-callback:
(exit:insert-can?-callback callback)
if callback returns #f, then the exit is aborted.