mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
modules/s_listen: Clear listeners before static destruction.
This commit is contained in:
parent
739028eeb5
commit
03c353599c
1 changed files with 8 additions and 1 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue