summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2003-08-13 22:44:12 +0000
committerMark Spruiell <mes@zeroc.com>2003-08-13 22:44:12 +0000
commit00b21da02d211ee986491e579412a896ac0cfa34 (patch)
tree218419ebe2db323e0c2136c06aef39115222babe /cpp/src/Ice/Instance.cpp
parentadding documentation about default factories (diff)
downloadice-00b21da02d211ee986491e579412a896ac0cfa34.tar.bz2
ice-00b21da02d211ee986491e579412a896ac0cfa34.tar.xz
ice-00b21da02d211ee986491e579412a896ac0cfa34.zip
adding defensive checks in destroy()
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index f86f0d8eb99..e2ad598d146 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -662,11 +662,25 @@ IceInternal::Instance::destroy()
{
assert(!_destroyed);
- _objectAdapterFactory->shutdown();
- _outgoingConnectionFactory->destroy();
+ if(_objectAdapterFactory)
+ {
+ _objectAdapterFactory->shutdown();
+ }
+
+ if(_outgoingConnectionFactory)
+ {
+ _outgoingConnectionFactory->destroy();
+ }
- _objectAdapterFactory->waitForShutdown();
- _outgoingConnectionFactory->waitUntilFinished();
+ if(_objectAdapterFactory)
+ {
+ _objectAdapterFactory->waitForShutdown();
+ }
+
+ if(_outgoingConnectionFactory)
+ {
+ _outgoingConnectionFactory->waitUntilFinished();
+ }
ThreadPoolPtr serverThreadPool;
ThreadPoolPtr clientThreadPool;