0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd:Ⓜ️ Cope with raii fails in m::init for right now.

This commit is contained in:
Jason Volk 2018-03-17 21:37:33 -07:00
parent 2b72fae7a1
commit 1780504cba
2 changed files with 7 additions and 1 deletions

View file

@ -72,6 +72,7 @@ namespace ircd
struct ircd::m::init
{
json::object config;
bool joined {false};
void bootstrap();
void listeners();

View file

@ -108,15 +108,18 @@ try
bootstrap();
join_ircd_room();
joined = true;
listeners();
}
catch(const m::error &e)
{
this->~init();
log.error("%s %s", e.what(), e.content);
throw;
}
catch(const std::exception &e)
{
this->~init();
log.error("%s", e.what());
throw;
}
@ -124,7 +127,9 @@ catch(const std::exception &e)
ircd::m::init::~init()
noexcept try
{
leave_ircd_room();
if(joined)
leave_ircd_room();
m::listeners.clear();
m::modules.clear();
}