From: Vsevolod Stakhov Date: Wed, 27 Jun 2018 11:05:44 +0000 (+0100) Subject: [Minor] Release backends more lately X-Git-Tag: 1.7.7~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87ce1ea217d2d96e4ad9c9131fb24b4f544759db;p=rspamd.git [Minor] Release backends more lately --- 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);