diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-26 18:17:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-26 18:17:32 +0100 |
commit | c2572cce4137e3931a056bf7282b5ce75a9f6691 (patch) | |
tree | 18990dd3af0114a405e04c3e73def67be5420465 /src | |
parent | 27a72f0afe0398cd20685a02d612d4dd043487a2 (diff) | |
download | rspamd-c2572cce4137e3931a056bf7282b5ce75a9f6691.tar.gz rspamd-c2572cce4137e3931a056bf7282b5ce75a9f6691.zip |
[Minor] Do not unref function as it is cleared with lua_State
Diffstat (limited to 'src')
-rw-r--r-- | src/libstat/stat_process.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index d720a77ab..9fe90a20e 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -906,19 +906,6 @@ rspamd_stat_has_classifier_symbols (struct rspamd_task *task, return FALSE; } -struct cl_cbref_dtor_data { - lua_State *L; - gint ref_idx; -}; - -static void -rspamd_stat_cbref_dtor (void *d) -{ - struct cl_cbref_dtor_data *data = (struct cl_cbref_dtor_data *)d; - - luaL_unref (data->L, LUA_REGISTRYINDEX, data->ref_idx); -} - gboolean rspamd_stat_check_autolearn (struct rspamd_task *task) { @@ -1069,16 +1056,7 @@ rspamd_stat_check_autolearn (struct rspamd_task *task) "`lua_bayes_learn`"); } else { - struct cl_cbref_dtor_data *dtor_data; - - dtor_data = (struct cl_cbref_dtor_data *) - rspamd_mempool_alloc (task->cfg->cfg_pool, - sizeof (*dtor_data)); cl->autolearn_cbref = luaL_ref (L, LUA_REGISTRYINDEX); - dtor_data->L = L; - dtor_data->ref_idx = cl->autolearn_cbref; - rspamd_mempool_add_destructor (task->cfg->cfg_pool, - rspamd_stat_cbref_dtor, dtor_data); } } |