static void free_plugin_state_t(plugin_state_t *pstate) { if (pstate->invalidate_list) free_invalidate_t_list(pstate->invalidate_list); if (pstate->config_file) TSfree(pstate->config_file); if (pstate->log) TSTextLogObjectDestroy(pstate->log); TSfree(pstate); }
/** * Handle ATS shutdown for IronBee plugin. * * Registered via atexit() during initialization, destroys the IB engine, * etc. * */ static void ibexit(void) { module_data_t *mod_data = &module_data; TSDebug("ironbee", "ibexit()"); if (mod_data->manager != NULL) { ib_manager_destroy(mod_data->manager); } if (mod_data->logger != NULL) { TSTextLogObjectFlush(mod_data->logger); TSTextLogObjectDestroy(mod_data->logger); mod_data->logger = NULL; } if (mod_data->txlogger != NULL) { TSTextLogObjectFlush(mod_data->txlogger); TSTextLogObjectDestroy(mod_data->txlogger); } if (mod_data->log_file != NULL) { free((void *)mod_data->log_file); mod_data->log_file = NULL; } ib_shutdown(); TSDebug("ironbee", "ibexit() done"); }
static void ibexit(void) { TSTextLogObjectDestroy(ironbee_log); ib_engine_destroy(ironbee); }