From 3bba7080b177e802df72b8c07ba867ddfd5ac07b Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Thu, 11 Apr 2019 13:33:42 +0800 Subject: [PATCH 4/4] release device_attr space when destroying Device obj Signed-off-by: Changcheng Liu diff --git a/src/msg/async/rdma/Infiniband.h b/src/msg/async/rdma/Infiniband.h index 12c1c420df..2805341ff8 100644 --- a/src/msg/async/rdma/Infiniband.h +++ b/src/msg/async/rdma/Infiniband.h @@ -79,8 +79,13 @@ class Device { ~Device() { if (active_port) { delete active_port; + active_port = nullptr; ceph_assert(ibv_close_device(ctxt) == 0); } + if (device_attr) { + delete device_attr; + device_attr = nullptr; + } } const char* get_name() { return name;} uint16_t get_lid() { return active_port->get_lid(); } -- 2.17.1