mirror of
https://github.com/matrix-construct/construct
synced 2024-05-28 15:53:46 +02:00
ircd::mods: Call module fini after child reference counts incremented.
This commit is contained in:
parent
af0fa4b2e8
commit
f8b9652555
12
ircd/mods.cc
12
ircd/mods.cc
|
@ -88,12 +88,6 @@ ircd::mods::unload(mod &mod)
|
|||
mod.location()
|
||||
};
|
||||
|
||||
// Call the user's unloading function here.
|
||||
assert(mod.header);
|
||||
assert(mod.header->meta);
|
||||
if(mod.header->meta->fini)
|
||||
mod.header->meta->fini();
|
||||
|
||||
// Save the children! dlclose() does not like to be called recursively during static
|
||||
// destruction of a module. The mod ctor recorded all of the modules loaded while this
|
||||
// module was loading so we can reverse the record and unload them here.
|
||||
|
@ -106,6 +100,12 @@ ircd::mods::unload(mod &mod)
|
|||
return shared_from(*ptr);
|
||||
});
|
||||
|
||||
// Call the user's unloading function here.
|
||||
assert(mod.header);
|
||||
assert(mod.header->meta);
|
||||
if(mod.header->meta->fini)
|
||||
mod.header->meta->fini();
|
||||
|
||||
mapi::static_destruction = false;
|
||||
mod.handle.unload();
|
||||
|
||||
|
|
Loading…
Reference in a new issue