From 0cfc8d2a7ca9bc32b7ed30ce9ad5a11abaf150f0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 10 Nov 2008 16:48:01 +0000 Subject: * don't call exit after catching exception on any particular thread as the other threads may still be running and this causes core dumps * catch any errors that occur in shutdown git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@712691 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/perftest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/tests/perftest.cpp b/qpid/cpp/src/tests/perftest.cpp index eb7235a09b..751a5f6288 100644 --- a/qpid/cpp/src/tests/perftest.cpp +++ b/qpid/cpp/src/tests/perftest.cpp @@ -226,8 +226,12 @@ struct Client : public Runnable { } ~Client() { - session.close(); - connection.close(); + try { + session.close(); + connection.close(); + } catch (const std::exception& e) { + std::cerr << "Error in shutdown: " << e.what() << std::endl; + } } }; @@ -429,7 +433,6 @@ struct Controller : public Client { } catch (const std::exception& e) { cout << "Controller exception: " << e.what() << endl; - exit(1); } } }; @@ -522,7 +525,6 @@ struct PublishThread : public Client { } catch (const std::exception& e) { cout << "PublishThread exception: " << e.what() << endl; - exit(1); } } }; @@ -621,7 +623,6 @@ struct SubscribeThread : public Client { } catch (const std::exception& e) { cout << "SubscribeThread exception: " << e.what() << endl; - exit(1); } } }; -- cgit v1.2.1