aboutsummaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/map.c b/src/map.c
index b864c6a42..12b833ae0 100644
--- a/src/map.c
+++ b/src/map.c
@@ -831,3 +831,22 @@ start_map_watch (void)
cur = g_list_next (cur);
}
}
+
+void
+remove_all_maps (void)
+{
+ GList *cur = maps;
+ struct rspamd_map *map;
+
+ /* First of all do synced read of data */
+ while (cur) {
+ map = cur->data;
+ event_del (&map->ev);
+ cur = g_list_next (cur);
+ }
+ g_list_free (maps);
+ maps = NULL;
+ memory_pool_delete (map_pool);
+ map_pool = NULL;
+}
+