mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd:Ⓜ️ Cope with raii fails in m::init for right now.
This commit is contained in:
parent
2b72fae7a1
commit
1780504cba
2 changed files with 7 additions and 1 deletions
|
@ -72,6 +72,7 @@ namespace ircd
|
|||
struct ircd::m::init
|
||||
{
|
||||
json::object config;
|
||||
bool joined {false};
|
||||
|
||||
void bootstrap();
|
||||
void listeners();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue