]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] One more try to fix the release order
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Sep 2021 15:53:49 +0000 (16:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Sep 2021 15:53:49 +0000 (16:53 +0100)
src/libserver/cfg_utils.c

index 1788be3b8955ba76ba30ba1253254d2e5e43f120..98b47efdc573100e2678bb1bbb6dbbeec5454ef0 100644 (file)
@@ -336,11 +336,6 @@ rspamd_config_free (struct rspamd_config *cfg)
        rspamd_re_cache_unref (cfg->re_cache);
        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);
@@ -351,6 +346,11 @@ rspamd_config_free (struct rspamd_config *cfg)
                rspamd_monitored_ctx_destroy (cfg->monitored_ctx);
        }
 
+       if (cfg->lua_state && cfg->own_lua_state) {
+               lua_thread_pool_free (cfg->lua_thread_pool);
+               lua_close (cfg->lua_state);
+       }
+
        rspamd_upstreams_library_unref (cfg->ups_ctx);
        HASH_CLEAR (hh, cfg->actions);