summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/IceGrid/replicaGroup/Server.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/cpp/test/IceGrid/replicaGroup/Server.cpp b/cpp/test/IceGrid/replicaGroup/Server.cpp
index 5049177c3fc..7802c6435da 100644
--- a/cpp/test/IceGrid/replicaGroup/Server.cpp
+++ b/cpp/test/IceGrid/replicaGroup/Server.cpp
@@ -24,9 +24,10 @@ int
Server::run(int, char**)
{
Ice::ObjectAdapterPtr adpt = communicator()->createObjectAdapter("ReplicatedAdapter");
- Ice::ObjectPtr object = new TestI(communicator()->getProperties());
- adpt->add(object, communicator()->stringToIdentity(communicator()->getProperties()->getProperty("Ice.ProgramName")));
- adpt->add(object, communicator()->stringToIdentity(communicator()->getProperties()->getProperty("Identity")));
+ Ice::PropertiesPtr properties = communicator()->getProperties();
+ Ice::ObjectPtr object = new TestI(properties);
+ adpt->add(object, communicator()->stringToIdentity(properties->getProperty("Ice.ProgramName")));
+ adpt->add(object, communicator()->stringToIdentity(properties->getProperty("Identity")));
shutdownOnInterrupt();
try
{
@@ -36,6 +37,13 @@ Server::run(int, char**)
catch(const Ice::ObjectAdapterDeactivatedException&)
{
}
+ catch(const Ice::CommunicatorDestroyedException&)
+ {
+ //
+ // getAdmin might raise this if communicator is shutdown by
+ // servant.
+ //
+ }
communicator()->waitForShutdown();
ignoreInterrupt();
return EXIT_SUCCESS;