summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Client.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-03-14 14:53:12 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-03-14 14:53:12 +0000
commit52702ce00b5f5da3307bdeadd2dc1f4c1259c779 (patch)
tree28a2def4cf7f09fb64f737a5cb125feae6fa4803 /cpp/src/IceGrid/Client.cpp
parentadded copyright (diff)
downloadice-52702ce00b5f5da3307bdeadd2dc1f4c1259c779.tar.bz2
ice-52702ce00b5f5da3307bdeadd2dc1f4c1259c779.tar.xz
ice-52702ce00b5f5da3307bdeadd2dc1f4c1259c779.zip
Bug 2017
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r--cpp/src/IceGrid/Client.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 0a0be250765..4b3c23bb4bf 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -359,6 +359,7 @@ Client::run(int argc, char* argv[])
replica = opts.optArg("replica");
}
+ Glacier2::RouterPrx router;
AdminSessionPrx session;
SessionKeepAliveThreadPtr keepAlive;
int status = EXIT_SUCCESS;
@@ -367,7 +368,6 @@ Client::run(int argc, char* argv[])
int timeout;
if(communicator()->getDefaultRouter())
{
- Glacier2::RouterPrx router;
try
{
router = Glacier2::RouterPrx::checkedCast(communicator()->getDefaultRouter());
@@ -648,16 +648,20 @@ Client::run(int argc, char* argv[])
keepAlive->getThreadControl().join();
}
- if(session)
+ try
{
- try
+ if(router)
{
- session->destroy();
+ router->destroySession();
}
- catch(const Ice::Exception&)
+ else
{
+ session->destroy();
}
}
+ catch(const Ice::Exception&)
+ {
+ }
throw;
}
@@ -668,7 +672,14 @@ Client::run(int argc, char* argv[])
{
try
{
- session->destroy();
+ if(router)
+ {
+ router->destroySession();
+ }
+ else
+ {
+ session->destroy();
+ }
}
catch(const Ice::Exception&)
{