commit 5275cae: [Fix] Postpone lua state destruction to allow lua dtors to be used

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 26 12:42:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-26 13:39:37 +0100
URL: https://github.com/rspamd/rspamd/commit/5275cae7517be59e0b451dbfacf5e5887feff619 (HEAD -> master)

[Fix] Postpone lua state destruction to allow lua dtors to be used

---
 src/libserver/cfg_utils.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index f65883c3e..d6dc95527 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -296,11 +296,6 @@ rspamd_config_free (struct rspamd_config *cfg)
 	rspamd_upstreams_library_unref (cfg->ups_ctx);
 	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);
@@ -319,6 +314,11 @@ rspamd_config_free (struct rspamd_config *cfg)
 		g_free (cfg->checksum);
 	}
 
+	if (cfg->lua_state && cfg->own_lua_state) {
+		lua_thread_pool_free (cfg->lua_thread_pool);
+		lua_close (cfg->lua_state);
+	}
+
 	REF_RELEASE (cfg->libs_ctx);
 
 	DL_FOREACH_SAFE (cfg->log_pipes, lp, ltmp) {


More information about the Commits mailing list