Called on application startup before configure is called.
Called when an application is stopped or unloaded.
Note that this is implemented using
window.beforeunload which doesn't allow any asynchronous code anymore.
I.e. this is the last tick.
beforeunload event, right before the window closes.
true in order to prevent exit.
Note: No async code allowed, this function has to run on one tick.