return ctx;
}
+void
+rspamd_deinit_libs (struct rspamd_external_libs_ctx *ctx)
+{
+ if (ctx != NULL) {
+ if (ctx->libmagic) {
+ magic_close (ctx->libmagic);
+ }
+
+ g_slice_free1 (sizeof (*ctx), ctx);
+ }
+}
+
guint64
rspamd_hash_seed (void)
{
*/
struct rspamd_external_libs_ctx* rspamd_init_libs (void);
+/**
+ * Destroy external libraries context
+ */
+void rspamd_deinit_libs (struct rspamd_external_libs_ctx *ctx);
+
/**
* Returns some statically initialized random hash seed
* @return hash seed
rspamd_symbols_cache_destroy (rspamd_main->cfg->cache);
rspamd_log_close (rspamd_main->logger);
rspamd_config_free (rspamd_main->cfg);
+ rspamd_deinit_libs (rspamd_main->cfg->libs_ctx);
g_free (rspamd_main->cfg);
g_free (rspamd_main);
event_base_free (ev_base);