mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
src: p2p: add exception spec to throwing destructors
The destructors get a noexcept(true) spec by default, but these destructors in fact throw exceptions. An alternative fix might be to not throw (most if not all of these throws are non-essential error-reporting/logging).
This commit is contained in:
parent
21dbc95b47
commit
68987416ad
@ -167,7 +167,7 @@ connection_basic::connection_basic(boost::asio::io_service& io_service, std::ato
|
||||
//boost::filesystem::create_directories("log/dr-monero/net/");
|
||||
}
|
||||
|
||||
connection_basic::~connection_basic() {
|
||||
connection_basic::~connection_basic() noexcept(false) {
|
||||
string remote_addr_str = "?";
|
||||
m_ref_sock_count--;
|
||||
try { remote_addr_str = socket_.remote_endpoint().address().to_string(); } catch(...){} ;
|
||||
|
@ -103,7 +103,7 @@ class connection_basic { // not-templated base class for rapid developmet of som
|
||||
// first counter is the ++/-- count of current sockets, the other socket_number is only-increasing ++ number generator
|
||||
connection_basic(boost::asio::io_service& io_service, std::atomic<long> &ref_sock_count, std::atomic<long> &sock_number);
|
||||
|
||||
virtual ~connection_basic();
|
||||
virtual ~connection_basic() noexcept(false);
|
||||
|
||||
// various handlers to be called from connection class:
|
||||
void do_send_handler_write(const void * ptr , size_t cb);
|
||||
|
@ -103,7 +103,7 @@ namespace net_utils
|
||||
_info_c("dbg/data","Data logger constructed");
|
||||
}
|
||||
|
||||
data_logger::~data_logger() {
|
||||
data_logger::~data_logger() noexcept(false) {
|
||||
_note_c("dbg/data","Destructor of the data logger");
|
||||
{
|
||||
boost::lock_guard<boost::mutex> lock(mMutex);
|
||||
|
@ -55,7 +55,7 @@ enum class data_logger_state { state_before_init, state_during_init, state_ready
|
||||
public:
|
||||
static data_logger &get_instance(); ///< singleton
|
||||
static void kill_instance(); ///< call this before ending main to allow more gracefull shutdown of the main singleton and it's background thread
|
||||
~data_logger(); ///< destr, will be called when singleton is killed when global m_obj dies. will kill theads etc
|
||||
~data_logger() noexcept(false); ///< destr, will be called when singleton is killed when global m_obj dies. will kill theads etc
|
||||
|
||||
private:
|
||||
data_logger(); ///< constructor is private, use only via singleton get_instance
|
||||
|
Loading…
Reference in New Issue
Block a user