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:
parent
809d01d7df
commit
7157a9cf8b
3 changed files with 28 additions and 28 deletions
|
@ -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()
|
||||
};
|
||||
|
|
26
ircd/fs.cc
26
ircd/fs.cc
|
@ -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
|
||||
|
|
27
ircd/m.cc
27
ircd/m.cc
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue