summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r--cpp/src/IceGrid/Client.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 57b37602460..f6fa90dff6c 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -572,9 +572,12 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
- keepAlive = new SessionKeepAliveThread(session, timeout / 2);
- keepAlive->start();
-
+ if(timeout > 0)
+ {
+ keepAlive = new SessionKeepAliveThread(session, timeout / 2);
+ keepAlive->start();
+ }
+
AdminPrx admin = session->getAdmin();
Ice::SliceChecksumDict serverChecksums = admin->getSliceChecksums();
@@ -653,8 +656,11 @@ Client::run(int argc, char* argv[])
throw;
}
- keepAlive->destroy();
- keepAlive->getThreadControl().join();
+ if(keepAlive)
+ {
+ keepAlive->destroy();
+ keepAlive->getThreadControl().join();
+ }
if(session)
{