diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-26 08:12:49 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-11-27 19:52:36 +0000 |
commit | d56a483abea2e7803ef47cbcb48a86a45e605410 (patch) | |
tree | db32811b6709883c1f93eb49315b4d422861bbdb /src/rpc | |
parent | rpc: always set the update field in update on sucess (diff) | |
download | monero-d56a483abea2e7803ef47cbcb48a86a45e605410.tar.xz |
rpc: do not propagate exceptions out of a dtor
Coverity 205415
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index dbacd489d..858b35df2 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -86,10 +86,14 @@ namespace RPCTracker(const char *rpc, tools::LoggingPerformanceTimer &timer): rpc(rpc), timer(timer) { } ~RPCTracker() { - boost::unique_lock<boost::mutex> lock(mutex); - auto &e = tracker[rpc]; - ++e.count; - e.time += timer.value(); + try + { + boost::unique_lock<boost::mutex> lock(mutex); + auto &e = tracker[rpc]; + ++e.count; + e.time += timer.value(); + } + catch (...) { /* ignore */ } } void pay(uint64_t amount) { boost::unique_lock<boost::mutex> lock(mutex); |