Browse Source

[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.
tags/1.8.0
Mikhail Galanin 5 years ago
parent
commit
be2a17a180
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      src/libserver/cfg_utils.c

+ 9
- 6
src/libserver/cfg_utils.c View File

@@ -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) {

Loading…
Cancel
Save