Defined in omni/core/ModuleExports.h

using omni::core::OnModuleUnloadFn = void()

Called when the module is about to be unloaded.

This function is called after OnModuleCanUnloadFn returns true.

The module is expected to clean-up any external references to code within the module. For example, unregistering asset types.

Any registered implementations from this module will have already been unregistered by the time this function is called.

This function must never fail.

It is safe to access the owning omni::core::ITypeFactory.

Attempting to load the module within OnModuleLoadFn may result in deadlock. It is safe for other threads to attempt the load the module during OnModuleUnloadFn, however, it is not safe for OnModuleUnloadFn to attempt to load the module.

No other module functions will be called while this function is active.

omni::core::ITypeFactory implements the following unload pseudo-code:

if (module->canUnload()) {