summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:06 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-09-08 16:49:06 +0000
commit8731e866a800cc64cd5bfccefb63646295870cd6 (patch)
treeae6fcb0e8ae8dae3aa816f09e30e6a17ee4b1bf8 /cpp/src
parent0f3bfd1b88c1a611c2fdb4c4134e52de802e024d (diff)
downloadqpid-python-8731e866a800cc64cd5bfccefb63646295870cd6.tar.gz
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
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/sys/rdma/rdma_wrap.cpp9
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);