From: Vsevolod Stakhov Date: Fri, 20 Nov 2015 17:09:32 +0000 (+0000) Subject: Add deinitialization for upstreams X-Git-Tag: 1.1.0~517 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cb689f2182bf840a83ebb828c82123d38b84e79;p=thirdparty%2Frspamd.git Add deinitialization for upstreams --- diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 53ce5add46..b2e97564f5 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -229,6 +229,7 @@ rspamd_config_free (struct rspamd_config *cfg) g_list_free (cfg->metrics_list); rspamd_symbols_cache_destroy (cfg->cache); REF_RELEASE (cfg->libs_ctx); + rspamd_upstreams_library_unref (cfg->ups_ctx); rspamd_mempool_delete (cfg->cfg_pool); lua_close (cfg->lua_state); g_slice_free1 (sizeof (*cfg), cfg); diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 5ef913f45e..9ed483f18d 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -139,6 +139,12 @@ rspamd_upstream_ctx_dtor (struct upstream_ctx *ctx) g_slice_free1 (sizeof (*ctx), ctx); } +void +rspamd_upstreams_library_unref (struct upstream_ctx *ctx) +{ + REF_RELEASE (ctx); +} + struct upstream_ctx * rspamd_upstreams_library_init (void) { diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h index a22a44589a..eab2be368d 100644 --- a/src/libutil/upstream.h +++ b/src/libutil/upstream.h @@ -27,6 +27,11 @@ struct upstream_ctx; */ struct upstream_ctx* rspamd_upstreams_library_init (void); +/** + * Remove reference from upstreams library + */ +void rspamd_upstreams_library_unref (struct upstream_ctx *ctx); + /** * Configure attributes of upstreams library * @param cfg