summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/Client.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-04-20 11:17:45 +0000
committerMarc Laukien <marc@zeroc.com>2005-04-20 11:17:45 +0000
commit1549f7bdb9709e6b0c31560abfb98af4fe5fae1a (patch)
treed4395897b9bb59c8ea824c3591a989112abd0698 /cpp/demo/Ice/session/Client.cpp
parentFixed a number of race conditions and made some destructor assertions safe. (diff)
downloadice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.tar.bz2
ice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.tar.xz
ice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.zip
more comments
Diffstat (limited to 'cpp/demo/Ice/session/Client.cpp')
-rwxr-xr-xcpp/demo/Ice/session/Client.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/demo/Ice/session/Client.cpp b/cpp/demo/Ice/session/Client.cpp
index 62050a085a4..d8392ea1b91 100755
--- a/cpp/demo/Ice/session/Client.cpp
+++ b/cpp/demo/Ice/session/Client.cpp
@@ -98,6 +98,7 @@ SessionClient::run(int argc, char* argv[])
{
return EXIT_FAILURE;
}
+ // XXX Remove. cin>>name already trims whitespace.
name = trim(name);
}
while(name.size() == 0);
@@ -185,16 +186,24 @@ SessionClient::run(int argc, char* argv[])
}
}
+ // XXX Wrong order. The refresher thread must be terminated
+ // before destroy is called, otherwise it might get
+ // ObjectNotExistException.
if(destroy)
{
session->destroy();
}
}
+ // XXX Remove. The caller already prints excpetion. (Only the
+ // equivalent of a finally bock is needed here for cleanup.
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
+ // XXX Would have to return EXIT_FAILURE, but this point is
+ // moot, see comment above.
}
+ // XXX Wrong destruction order, see comment above.
refresh->terminate();
refresh->getThreadControl().join();
@@ -214,6 +223,7 @@ SessionClient::menu()
"?: help\n";
}
+// XXX Remove.
string
SessionClient::trim(const string& s)
{