summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/Client.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-04-22 00:18:21 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-04-22 00:18:21 +0000
commitdf25502349ec2ebeadf1b9880bcec8e9e486d459 (patch)
tree7f3c9b73b5d3039039f2f7766db8a11137db8895 /cpp/demo/Ice/session/Client.cpp
parentalign with icej for bug 245 (diff)
downloadice-df25502349ec2ebeadf1b9880bcec8e9e486d459.tar.bz2
ice-df25502349ec2ebeadf1b9880bcec8e9e486d459.tar.xz
ice-df25502349ec2ebeadf1b9880bcec8e9e486d459.zip
addressed Bernards comments.
Diffstat (limited to 'cpp/demo/Ice/session/Client.cpp')
-rwxr-xr-xcpp/demo/Ice/session/Client.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/demo/Ice/session/Client.cpp b/cpp/demo/Ice/session/Client.cpp
index 281d8b9e05e..07ddf8cb780 100755
--- a/cpp/demo/Ice/session/Client.cpp
+++ b/cpp/demo/Ice/session/Client.cpp
@@ -181,10 +181,13 @@ SessionClient::run(int argc, char* argv[])
//
// The refresher thread must be terminated before destroy is
- // called, otherwise it might get ObjectNotExistException.
+ // called, otherwise it might get ObjectNotExistException. refresh
+ // is set to 0 so that if session->destroy() raises an exception
+ // the thread will not be re-terminated and re-joined.
//
refresh->terminate();
refresh->getThreadControl().join();
+ refresh = 0;
if(destroy)
{
@@ -197,8 +200,11 @@ SessionClient::run(int argc, char* argv[])
// The refresher thread must be terminated in the event of a
// failure.
//
- refresh->terminate();
- refresh->getThreadControl().join();
+ if(refresh)
+ {
+ refresh->terminate();
+ refresh->getThreadControl().join();
+ }
throw;
}