0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::mods: Assertion child unload is not self.

This commit is contained in:
Jason Volk 2019-09-26 21:51:33 -07:00
parent 7d1da07894
commit 637fb4a6ba

View file

@ -93,10 +93,11 @@ ircd::mods::unload(mod &mod)
// 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.
std::vector<std::shared_ptr<mods::mod>> children(mod.children.size());
std::transform(begin(mod.children), end(mod.children), begin(children), []
std::transform(begin(mod.children), end(mod.children), begin(children), [&mod]
(auto *const &ptr)
{
assert(ptr);
assert(ptr != std::addressof(mod));
const auto ret(shared_from(*ptr));
return ret.use_count() > 2? ret : std::shared_ptr<mods::mod>{};
});