summaryrefslogtreecommitdiff
path: root/cpp/src/IceBox/ServiceManagerI.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-10-20 05:55:31 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-10-20 05:55:31 +0000
commit273233e4fff5c7a18ccedfa4fe984740fa4cf3b4 (patch)
tree764767525c9de80e166cd0328494f7b5ad16dd4f /cpp/src/IceBox/ServiceManagerI.cpp
parenthttp://wiki.zeroc.com/bugzilla/show_bug.cgi?id=528 (diff)
downloadice-273233e4fff5c7a18ccedfa4fe984740fa4cf3b4.tar.bz2
ice-273233e4fff5c7a18ccedfa4fe984740fa4cf3b4.tar.xz
ice-273233e4fff5c7a18ccedfa4fe984740fa4cf3b4.zip
http://wiki.zeroc.com/bugzilla/show_bug.cgi?id=528
Diffstat (limited to 'cpp/src/IceBox/ServiceManagerI.cpp')
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index 14317a827c9..216e4f5abae 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -338,7 +338,47 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
//
// Start the service.
//
- info.service->start(service, communicator, serviceArgs);
+ try
+ {
+ info.service->start(service, communicator, serviceArgs);
+ }
+ catch(...)
+ {
+ if(info.communicator)
+ {
+ try
+ {
+ info.communicator->shutdown();
+ info.communicator->waitForShutdown();
+ }
+ catch(const Ice::CommunicatorDestroyedException&)
+ {
+ //
+ // Ignore, the service might have already destroyed
+ // the communicator for its own reasons.
+ //
+ }
+ catch(const Ice::Exception& ex)
+ {
+ Warning out(_logger);
+ out << "ServiceManager: exception in shutting down communicator for service " << service << ":\n";
+ out << ex;
+ }
+
+ try
+ {
+ info.communicator->destroy();
+ info.communicator = 0;
+ }
+ catch(const Exception& ex)
+ {
+ Warning out(_logger);
+ out << "ServiceManager: exception in shutting down communicator for service " << service << ":\n";
+ out << ex;
+ }
+ }
+ throw;
+ }
info.library = library;
_services[service] = info;
@@ -470,3 +510,4 @@ IceBox::ServiceManagerI::stopAll()
_services.clear();
}
+