mirror of
https://github.com/matrix-construct/construct
synced 2024-11-04 21:08:57 +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::critical
|
||||||
{
|
{
|
||||||
log, "socket(%p) ~client(%p): %s",
|
log, "~client(%p): %s",
|
||||||
sock.get(),
|
|
||||||
this,
|
this,
|
||||||
e.what()
|
e.what()
|
||||||
};
|
};
|
||||||
|
|
14
ircd/fs.cc
14
ircd/fs.cc
|
@ -1690,21 +1690,21 @@ noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
ircd::fs::fd::~fd()
|
ircd::fs::fd::~fd()
|
||||||
noexcept try
|
noexcept
|
||||||
{
|
{
|
||||||
if(fdno < 0)
|
if(likely(fdno >= 0)) try
|
||||||
return;
|
{
|
||||||
|
|
||||||
syscall(::close, fdno);
|
syscall(::close, fdno);
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
log::critical
|
log::critical
|
||||||
{
|
{
|
||||||
"Failed to close fd:%d :%s",
|
"Failed to close fd:%d :%s",
|
||||||
fdno,
|
fdno,
|
||||||
e.what()
|
e.what()
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
17
ircd/m.cc
17
ircd/m.cc
|
@ -4796,7 +4796,6 @@ const
|
||||||
|
|
||||||
/// Primary hook ctor
|
/// Primary hook ctor
|
||||||
ircd::m::hook::base::base(const json::members &members)
|
ircd::m::hook::base::base(const json::members &members)
|
||||||
try
|
|
||||||
:_feature
|
:_feature
|
||||||
{
|
{
|
||||||
_hook_make_feature(members)
|
_hook_make_feature(members)
|
||||||
|
@ -4810,18 +4809,20 @@ try
|
||||||
feature
|
feature
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
site *site;
|
site *site; try
|
||||||
|
{
|
||||||
if((site = find_site()))
|
if((site = find_site()))
|
||||||
site->add(*this);
|
site->add(*this);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
if(!registered)
|
if(registered)
|
||||||
throw;
|
{
|
||||||
|
|
||||||
auto *const site(find_site());
|
auto *const site(find_site());
|
||||||
assert(site != nullptr);
|
assert(site != nullptr);
|
||||||
site->del(*this);
|
site->del(*this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ircd::m::hook::base::~base()
|
ircd::m::hook::base::~base()
|
||||||
|
|
Loading…
Reference in a new issue