diff options
author | Marc Laukien <marc@zeroc.com> | 2005-04-20 11:17:45 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2005-04-20 11:17:45 +0000 |
commit | 1549f7bdb9709e6b0c31560abfb98af4fe5fae1a (patch) | |
tree | d4395897b9bb59c8ea824c3591a989112abd0698 /cpp/demo/Ice/session/Client.cpp | |
parent | Fixed a number of race conditions and made some destructor assertions safe. (diff) | |
download | ice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.tar.bz2 ice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.tar.xz ice-1549f7bdb9709e6b0c31560abfb98af4fe5fae1a.zip |
more comments
Diffstat (limited to 'cpp/demo/Ice/session/Client.cpp')
-rwxr-xr-x | cpp/demo/Ice/session/Client.cpp | 10 |
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) { |