diff options
-rw-r--r-- | cpp/src/qpid/sys/rdma/rdma_wrap.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/sys/rdma/rdma_wrap.cpp b/cpp/src/qpid/sys/rdma/rdma_wrap.cpp index 4883f0ce14..510291f9b3 100644 --- a/cpp/src/qpid/sys/rdma/rdma_wrap.cpp +++ b/cpp/src/qpid/sys/rdma/rdma_wrap.cpp @@ -139,14 +139,17 @@ namespace Rdma { } QueuePair::~QueuePair() { + // Reset back pointer in case someone else has the qp + qp->qp_context = 0; + + // Dispose queue pair before we ack events + qp.reset(); + if (outstandingSendEvents > 0) ::ibv_ack_cq_events(scq.get(), outstandingSendEvents); if (outstandingRecvEvents > 0) ::ibv_ack_cq_events(rcq.get(), outstandingRecvEvents); - // Reset back pointer in case someone else has the qp - qp->qp_context = 0; - // Deallocate recv buffer memory if (rmr) delete [] static_cast<char*>(rmr->addr); |