0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd: Handle exceptions before unwind of class member reference.

This commit is contained in:
Jason Volk 2019-06-23 23:17:49 -06:00
parent 809d01d7df
commit 7157a9cf8b
3 changed files with 28 additions and 28 deletions

View file

@ -640,8 +640,7 @@ catch(const std::exception &e)
{
log::critical
{
log, "socket(%p) ~client(%p): %s",
sock.get(),
log, "~client(%p): %s",
this,
e.what()
};

View file

@ -1690,21 +1690,21 @@ noexcept
}
ircd::fs::fd::~fd()
noexcept try
noexcept
{
if(fdno < 0)
return;
syscall(::close, fdno);
}
catch(const std::exception &e)
{
log::critical
if(likely(fdno >= 0)) try
{
"Failed to close fd:%d :%s",
fdno,
e.what()
};
syscall(::close, fdno);
}
catch(const std::exception &e)
{
log::critical
{
"Failed to close fd:%d :%s",
fdno,
e.what()
};
}
}
int

View file

@ -4796,7 +4796,6 @@ const
/// Primary hook ctor
ircd::m::hook::base::base(const json::members &members)
try
:_feature
{
_hook_make_feature(members)
@ -4810,18 +4809,20 @@ try
feature
}
{
site *site;
if((site = find_site()))
site->add(*this);
}
catch(...)
{
if(!registered)
throw;
auto *const site(find_site());
assert(site != nullptr);
site->del(*this);
site *site; try
{
if((site = find_site()))
site->add(*this);
}
catch(...)
{
if(registered)
{
auto *const site(find_site());
assert(site != nullptr);
site->del(*this);
}
}
}
ircd::m::hook::base::~base()