summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-03-12 17:05:29 +0000
committerGordon Sim <gsim@apache.org>2009-03-12 17:05:29 +0000
commit1d5ef574d0dc29d1bfce20dcbd091b2a9aaa7809 (patch)
treeaacf6b2f7bbb0f9be99fc342177bc95187fbc541 /cpp
parent20538b5f798445da1105a33b3c63aa4782b35ddb (diff)
downloadqpid-python-1d5ef574d0dc29d1bfce20dcbd091b2a9aaa7809.tar.gz
QPID-1729: trivial cleanup for shutdown in the case that perftest loses connection(s).
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@752937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/tests/perftest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/tests/perftest.cpp b/cpp/src/tests/perftest.cpp
index 6456bc8304..ae07da7f6c 100644
--- a/cpp/src/tests/perftest.cpp
+++ b/cpp/src/tests/perftest.cpp
@@ -238,8 +238,10 @@ struct Client : public Runnable {
~Client() {
try {
- session.close();
- connection->close();
+ if (connection->isOpen()) {
+ session.close();
+ connection->close();
+ }
} catch (const std::exception& e) {
std::cerr << "Error in shutdown: " << e.what() << std::endl;
}