carbOnReloadDependency

Defined in carb/PluginCoreUtils.h

void carbOnReloadDependency(carb::PluginReloadState reloadState, void *pluginInterface, carb::PluginImplDesc desc)

An optional function that a plugin author can export from their plugin to receive dependency reload notifications.

When carb::Framework::tryReloadPlugins is called, if a plugin is reloaded, any plugins which have acquired interfaces from the reloading plugin will receive notifications before and after the plugin is reloaded via this function. This serves as a guide for plugin authors.

Providing this function is completely optional.

Typical things this function might do (reloadState == eBefore):

  • Release objects created from the interface

  • Clear cached pointers to the interface

Typical things this function might do (reloadState == eAfter):

  • Update pointers to the new interface

  • Reinstate objects

The type of this function is carb::OnReloadDependencyFn and named kCarbOnReloadDependencyFnName.

Parameters
  • reloadState – the callback phase

  • pluginInterface – a pointer to the interface

  • desc – a descriptor for the plugin