aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/degesch.c b/degesch.c
index c4a7a43..78a5f66 100644
--- a/degesch.c
+++ b/degesch.c
@@ -6567,14 +6567,12 @@ server_remove (struct app_context *ctx, struct server *s)
if (s->buffer)
buffer_remove_safe (ctx, s->buffer);
- struct str_map_iter iter;
- str_map_iter_init (&iter, &s->irc_buffer_map);
- struct buffer *buffer, *next = str_map_iter_next (&iter);
- for (buffer = next; buffer; buffer = next)
- {
- next = str_map_iter_next (&iter);
+ struct str_map_unset_iter iter;
+ str_map_unset_iter_init (&iter, &s->irc_buffer_map);
+ struct buffer *buffer;
+ while ((buffer = str_map_unset_iter_next (&iter)))
buffer_remove_safe (ctx, buffer);
- }
+ str_map_unset_iter_free (&iter);
hard_assert (!s->buffer);
hard_assert (!s->irc_buffer_map.len);