aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_utils.c
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-10 15:14:05 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-10 15:14:05 +0100
commitbe2a17a180e84fac41c7f4c79bdafbacbd6e067c (patch)
tree0637c894a3c8d32744ade4fdace39e0524747093 /src/libserver/cfg_utils.c
parent1fc19462b17aa958552f5aba0d3fbe9083b4bc19 (diff)
downloadrspamd-be2a17a180e84fac41c7f4c79bdafbacbd6e067c.tar.gz
rspamd-be2a17a180e84fac41c7f4c79bdafbacbd6e067c.zip
[Minor] Change deinit order
some destructors in Lua could require Redis pool, that is why the pool should be shud down after lua_state. While redis pool is created in the mempool.
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r--src/libserver/cfg_utils.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 016556912..d07939374 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -232,11 +232,6 @@ rspamd_config_free (struct rspamd_config *cfg)
g_list_free (cfg->classifiers);
g_list_free (cfg->workers);
rspamd_symbols_cache_destroy (cfg->cache);
-#ifdef WITH_HIREDIS
- if (cfg->redis_pool) {
- rspamd_redis_pool_destroy (cfg->redis_pool);
- }
-#endif
ucl_object_unref (cfg->rcl_obj);
ucl_object_unref (cfg->config_comments);
ucl_object_unref (cfg->doc_strings);
@@ -257,13 +252,21 @@ rspamd_config_free (struct rspamd_config *cfg)
rspamd_re_cache_unref (cfg->re_cache);
rspamd_upstreams_library_unref (cfg->ups_ctx);
- rspamd_mempool_delete (cfg->cfg_pool);
g_ptr_array_free (cfg->c_modules, TRUE);
if (cfg->lua_state && cfg->own_lua_state) {
lua_thread_pool_free (cfg->lua_thread_pool);
lua_close (cfg->lua_state);
}
+
+#ifdef WITH_HIREDIS
+ if (cfg->redis_pool) {
+ rspamd_redis_pool_destroy (cfg->redis_pool);
+ }
+#endif
+
+ rspamd_mempool_delete (cfg->cfg_pool);
+
REF_RELEASE (cfg->libs_ctx);
DL_FOREACH_SAFE (cfg->log_pipes, lp, ltmp) {