From 03c353599c1ecd1def71f7db416e68fc79609fdc Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 1 Sep 2018 22:23:08 -0700 Subject: [PATCH] modules/s_listen: Clear listeners before static destruction. --- modules/s_listen.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/s_listen.cc b/modules/s_listen.cc index 9fbc7aab6..95597b773 100644 --- a/modules/s_listen.cc +++ b/modules/s_listen.cc @@ -18,12 +18,13 @@ static bool load_listener(const m::event &); extern "C" bool unload_listener(const string_view &name); extern "C" bool load_listener(const string_view &name); static void init_listeners(); +static void on_unload(); static void on_load(); mapi::header IRCD_MODULE { - "Server listeners", on_load + "Server listeners", on_load, on_unload }; /// Active listener state @@ -51,6 +52,12 @@ on_load() init_listeners(); } +void +on_unload() +{ + listeners.clear(); +} + void init_listeners() {