summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IceGrid/Client.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 5633d5bac2b..965fc931a3b 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -605,27 +605,33 @@ Client::run(int argc, char* argv[])
keepAlive->getThreadControl().join();
}
- try
- {
- session->destroy();
- }
- catch(const Ice::Exception&)
- {
- }
+ if(session)
+ {
+ try
+ {
+ session->destroy();
+ }
+ catch(const Ice::Exception&)
+ {
+ }
+ }
throw;
}
keepAlive->destroy();
keepAlive->getThreadControl().join();
- try
- {
- session->destroy();
- }
- catch(const Ice::Exception&)
+ if(session)
{
- // Ignore. If the registry has been shutdown this will cause
- // an exception.
+ try
+ {
+ session->destroy();
+ }
+ catch(const Ice::Exception&)
+ {
+ // Ignore. If the registry has been shutdown this will cause
+ // an exception.
+ }
}
return status;