diff --git a/matrix/commands.py b/matrix/commands.py index 99b6889..cdb6444 100644 --- a/matrix/commands.py +++ b/matrix/commands.py @@ -1547,7 +1547,7 @@ def matrix_server_command_delete(args): W.prnt("", message) return - for buf in server.buffers.values(): + for buf in list(server.buffers.values()): W.buffer_close(buf) if server.server_buffer: @@ -1556,6 +1556,10 @@ def matrix_server_command_delete(args): for option in server.config._option_ptrs.values(): W.config_option_free(option) + if server.timer_hook: + W.unhook(server.timer_hook) + server.timer_hook = None + message = ( "matrix: server {color}{server}{ncolor} has been " "deleted" ).format(