diff options
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r-- | src/libserver/cfg_utils.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 0f38cc389..3761d0861 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -245,18 +245,21 @@ rspamd_config_new (enum rspamd_config_init_flags flags) void rspamd_config_free (struct rspamd_config *cfg) { - struct rspamd_config_post_load_script *sc, *sctmp; + struct rspamd_config_cfg_lua_script *sc, *sctmp; struct rspamd_config_settings_elt *set, *stmp; struct rspamd_worker_log_pipe *lp, *ltmp; - DL_FOREACH_SAFE (cfg->finish_callbacks, sc, sctmp) { + /* Scripts part */ + DL_FOREACH_SAFE (cfg->on_term_scripts, sc, sctmp) { luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref); - g_free (sc); } - DL_FOREACH_SAFE (cfg->on_load, sc, sctmp) { + DL_FOREACH_SAFE (cfg->on_load_scripts, sc, sctmp) { + luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref); + } + + DL_FOREACH_SAFE (cfg->post_init_scripts, sc, sctmp) { luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref); - g_free (sc); } DL_FOREACH_SAFE (cfg->setting_ids, set, stmp) { @@ -870,6 +873,10 @@ rspamd_config_post_load (struct rspamd_config *cfg, rspamd_map_preload (cfg); } + if (opts & RSPAMD_CONFIG_INIT_POST_LOAD_LUA) { + rspamd_lua_run_config_post_init (cfg->lua_state, cfg); + } + return ret; } |