diff options
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r-- | cpp/src/IcePatch/Client.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp index 7702792361e..ccae39ef90d 100644 --- a/cpp/src/IcePatch/Client.cpp +++ b/cpp/src/IcePatch/Client.cpp @@ -55,6 +55,8 @@ IcePatch::Client::usage() int IcePatch::Client::run(int argc, char* argv[]) { + RouterPrx router; + try { for (int i = 1; i < argc; ++i) @@ -99,7 +101,6 @@ IcePatch::Client::run(int argc, char* argv[]) ByteSeq publicKey; ByteSeq routerCert; - RouterPrx router; while (!router) { string id; @@ -195,8 +196,17 @@ IcePatch::Client::run(int argc, char* argv[]) catch (const FileAccessException& ex) { cerr << appName() << ": " << ex << ":\n" << ex.reason << endl; + if (router) + { + router->shutdown(); + } return EXIT_FAILURE; } + + if (router) + { + router->shutdown(); + } return EXIT_SUCCESS; } |