aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/libvapi-safe
diff options
context:
space:
mode:
authorMichele Papalini <micpapal@cisco.com>2023-02-02 17:49:46 +0100
committerMichele Papalini <micpapal@cisco.com>2023-02-07 10:25:01 +0100
commit8a7e75e84a31180d51b9970d526709ec4dca2030 (patch)
tree48c1d88f0a5635e75fa9fc0eb898b861b42477e8 /hicn-plugin/libvapi-safe
parentb96d1545a8d2a173dc5911ed0bca3e04dbb02176 (diff)
fix(hicn): fix bugs reported by sonarqube
Ref: HICN-837 Signed-off-by: Michele Papalini <micpapal@cisco.com> Change-Id: I0d02a11361b1ba5ad50123b2dd142c961998922f
Diffstat (limited to 'hicn-plugin/libvapi-safe')
-rw-r--r--hicn-plugin/libvapi-safe/src/vapi_safe.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/hicn-plugin/libvapi-safe/src/vapi_safe.cc b/hicn-plugin/libvapi-safe/src/vapi_safe.cc
index 8747ca738..dc2db329e 100644
--- a/hicn-plugin/libvapi-safe/src/vapi_safe.cc
+++ b/hicn-plugin/libvapi-safe/src/vapi_safe.cc
@@ -312,16 +312,21 @@ public:
~VapiGlobalConnection ()
{
- std::cout << "\"adios1" << std::endl;
if (!isConnected ())
{
return;
}
- std::cout << "\"adios" << std::endl;
std::unique_lock<std::mutex> lock (vapi_mtx_);
vapi_disconnect (vapi_ctx_);
vapi_ctx_free (vapi_ctx_);
- timer_.cancel ();
+ try
+ {
+ timer_.cancel ();
+ }
+ catch (asio::system_error e)
+ {
+ // quit anyway
+ }
}
private: