summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Service.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-02-07 15:55:01 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-02-07 15:55:01 +0000
commit19d76c498864186d3d3e37a037eb05fa1bf1a75b (patch)
tree41dd2158953680e71d4350f2d8b5f55f857faaad /cpp/src/Ice/Service.cpp
parentFixed icej version (diff)
downloadice-19d76c498864186d3d3e37a037eb05fa1bf1a75b.tar.bz2
ice-19d76c498864186d3d3e37a037eb05fa1bf1a75b.tar.xz
ice-19d76c498864186d3d3e37a037eb05fa1bf1a75b.zip
Fix potential NullHandleException
Diffstat (limited to 'cpp/src/Ice/Service.cpp')
-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;