omni::kit::exec::core::unstable::addClearCallback

Defined in omni/kit/exec/core/unstable/IExecutionControllerFactory.h

template<typename Fn>
inline void omni::kit::exec::core::unstable::addClearCallback(Fn &&fn) noexcept

Adds a callback that will be invoked when omni::kit::exec::core::unstable::IExecutionControllerFactory::clear() is called.

omni::kit::exec::core::unstable::IExecutionControllerFactory::clear() is called when a .dll/.so providing execution framework functionality is unloaded (e.g. a plugin that provides a pass or node definition). The purpose of the given callback is to provide the plugin calling addClearCallback an opportunity to remove pointers to code that may be unloaded. For example, OmniGraph uses this callback to remove any omni::graph::exec::unstable::IDef pointers in its plugins.

Do not call this method directly. Rather, call OMNI_KIT_EXEC_CORE_ON_MODULE_STARTED in either a plugin’s carbOnPluginStartup or onStarted.

The callback will be removed/unregistered by OMNI_KIT_EXEC_CORE_ON_MODULE_UNLOAD.