NAME
A function of omni::application::shutdown_handler
omni::application::shutdown_handler::attach
A function of omni::application::shutdown_handler
#include <omni/application.hpp>
void omni::application::shutdown_handler::attach(const omni::callback& shutdown_func)
DESCRIPTION
When a delegate is attached to the underlying shutdown handler, the delegate will be invoked before the
top
When a delegate is attached to the underlying shutdown handler, the delegate will be invoked before the
omni::application::run function returns in the order it was attached.
top
ERRORS
If an exception occurs on an attached delegate, it will be handled according to
top
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
top
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
Be aware that the
top
Be aware that the
std::atexit function will call any functions in the reverse order registered. So if omni::application::run is called after any other calls to register a function with std::atexit in user code, then the underlying exit handler event will be called accordingly in order attached; in other words, if you were to call std::atexit(&some_function) then shutdown_handler::attach(&some_func) and call omni::application::run, the Omni exit handler will be called first, then some_function last. Calling this function after the shutdown handler has been called will have no effect on the handler since it will have already been called.
top