diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-08-13 22:44:12 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-08-13 22:44:12 +0000 |
commit | 00b21da02d211ee986491e579412a896ac0cfa34 (patch) | |
tree | 218419ebe2db323e0c2136c06aef39115222babe /cpp/src/Ice/Instance.cpp | |
parent | adding documentation about default factories (diff) | |
download | ice-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.cpp | 22 |
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; |