omni::application::shutdown_handler
NAME

omni::application::shutdown_handler

A namespace of omni::application

#include <omni/application.hpp>
namespace omni::application::shutdown_handler

MEMBERS

void omni::application::shutdown_handler::attach(const omni::callback& shutdown_func)
void omni::application::shutdown_handler::detach(const omni::callback& shutdown_func)

SYNOPSIS

The shutdown_handler namespace facilitates functions that allow invoking a function before the omni::application::run context returns.

top

DESCRIPTION

If an omni::application::run function is called, any attached shutdown handler delegates will be called in the order attached. The handler is called immediately before omni::application::run returns, allowing you to preform any actions needed (like adjust the return signal) before hand.

top

ERRORS

If an exception occurs on an attached delegate, it will be handled according to omni::sync::user_thread_exception and omni::sync::unhandled_thread_exception.

top


CONSIDERATIONS

This function will only have an effect if you have explicitly called one of the omni::application::run functions to block the main thread until program completion.

top


NOTES

This handler is called before the omni::application::run function returns whereas the omni::application::exit_handler is called before the program exits.

top