mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +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()
|
||||||
};
|
};
|
||||||
|
|
26
ircd/fs.cc
26
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);
|
|
||||||
}
|
|
||||||
catch(const std::exception &e)
|
|
||||||
{
|
|
||||||
log::critical
|
|
||||||
{
|
{
|
||||||
"Failed to close fd:%d :%s",
|
syscall(::close, fdno);
|
||||||
fdno,
|
}
|
||||||
e.what()
|
catch(const std::exception &e)
|
||||||
};
|
{
|
||||||
|
log::critical
|
||||||
|
{
|
||||||
|
"Failed to close fd:%d :%s",
|
||||||
|
fdno,
|
||||||
|
e.what()
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
27
ircd/m.cc
27
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()))
|
{
|
||||||
site->add(*this);
|
if((site = find_site()))
|
||||||
}
|
site->add(*this);
|
||||||
catch(...)
|
}
|
||||||
{
|
catch(...)
|
||||||
if(!registered)
|
{
|
||||||
throw;
|
if(registered)
|
||||||
|
{
|
||||||
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