carbOnPluginQuickShutdown

Defined in carb/PluginCoreUtils.h

void carbOnPluginQuickShutdown()

An optional function that a plugin author can export from their plugin to quick-shutdown their plugin.

The Framework will call this function for each plugin only when carb::quickReleaseFrameworkAndTerminate is called, in the unload order determined by the Framework. This serves as a guide for plugin authors.

This function is mutually exclusive with carbOnPluginShutdown; either this function or that one is called depending on the shutdown type.

Providing this function is completely optional.

Since carb::quickReleaseFrameworkAndTerminate will terminate the process without running static destructors or closing files/connections/etc., this function should be provided to do the bare minimum of work as quickly as possible to ensure data is written out and stable.

Any interfaces declared as a dependency in CARB_PLUGIN_IMPL_DEPS will still be available to this plugin when this function is called.

While this function can acquire new interfaces (unlike carbOnPluginShutdown), it is generally undesired to do so as that can be time-consuming and antithetical to quick shutdown.

Typical things this function might do:

  • Close network connections

  • Commit database transactions

  • Flush and close files open for write

The type of this function is carb::OnPluginQuickShutdownFn and named kCarbOnPluginQuickShutdownFnName.