diff options
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) { |