diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-27 12:05:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-27 12:05:44 +0100 |
commit | 87ce1ea217d2d96e4ad9c9131fb24b4f544759db (patch) | |
tree | 59cf6a9967f269c81adbf2f66d5fb6c4ffdf1436 | |
parent | 86dd306933f46dc1cef0c933ba63319121dca4f5 (diff) | |
download | rspamd-87ce1ea217d2d96e4ad9c9131fb24b4f544759db.tar.gz rspamd-87ce1ea217d2d96e4ad9c9131fb24b4f544759db.zip |
[Minor] Release backends more lately
-rw-r--r-- | src/libutil/map.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 8f36541a2..5a0c859a3 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -1812,11 +1812,6 @@ rspamd_map_remove_all (struct rspamd_config *cfg) for (cur = cfg->maps; cur != NULL; cur = g_list_next (cur)) { map = cur->data; - for (i = 0; i < map->backends->len; i ++) { - bk = g_ptr_array_index (map->backends, i); - MAP_RELEASE (bk, "rspamd_map_backend"); - } - if (g_atomic_int_compare_and_exchange (&map->cache->available, 1, 0)) { if (map->cur_cache_cbd) { MAP_RELEASE (map->cur_cache_cbd->shm, "rspamd_http_map_cached_cbdata"); @@ -1840,6 +1835,11 @@ rspamd_map_remove_all (struct rspamd_config *cfg) map->dtor (&cbdata); *map->user_data = NULL; } + + for (i = 0; i < map->backends->len; i ++) { + bk = g_ptr_array_index (map->backends, i); + MAP_RELEASE (bk, "rspamd_map_backend"); + } } g_list_free (cfg->maps); |