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:
parent
9a2382b444
commit
0bd1d03bbc
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue