summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rwxr-xr-xcpp/src/Ice/Service.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index d4232d2aefe..80bd46c13ff 100755
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -613,12 +613,15 @@ Ice::Service::run(int& argc, char* argv[], const InitializationData& initData)
error("service caught unhandled C++ exception");
}
- try
- {
- _communicator->destroy();
- }
- catch(...)
+ if(_communicator)
{
+ try
+ {
+ _communicator->destroy();
+ }
+ catch(...)
+ {
+ }
}
return status;
@@ -1840,12 +1843,15 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
close(fds[1]);
}
- try
- {
- _communicator->destroy();
- }
- catch(...)
+ if(_communicator)
{
+ try
+ {
+ _communicator->destroy();
+ }
+ catch(...)
+ {
+ }
}
return status;