From 8731e866a800cc64cd5bfccefb63646295870cd6 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 8 Sep 2010 16:49:06 +0000 Subject: Dispose the queue pair before acknowledging channel events when destroying Rdma::QueuePair to stop any events being processed during destruction git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995133 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/rdma/rdma_wrap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cpp/src') 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(rmr->addr); -- cgit v1.2.1