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

ircd:Ⓜ️:homeserver: Unload any loaded modules for ctor error.

This commit is contained in:
Jason Volk 2020-05-09 19:56:20 -07:00
parent 9a2382b444
commit 0bd1d03bbc
2 changed files with 17 additions and 4 deletions

View file

@ -68,7 +68,13 @@ struct ircd::m::homeserver
std::unique_ptr<struct conf> conf;
/// Requested modules.
std::vector<string_view> modules;
struct modules
:std::vector<string_view>
{
using std::vector<string_view>::vector;
~modules() noexcept;
}
modules;
/// vm
std::shared_ptr<vm::init> vm;

View file

@ -299,10 +299,17 @@ noexcept
if(primary == this)
_fetch.reset(nullptr);
}
if(primary == this)
for(auto rit(rbegin(modules)); rit != rend(modules); ++rit)
mods::imports.erase(*rit);
//
// homeserver modules
//
ircd::m::homeserver::modules::~modules()
noexcept
{
for(auto rit(std::rbegin(*this)); rit != std::rend(*this); ++rit)
mods::imports.erase(*rit);
}
//