summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2014-10-03 15:34:33 -0230
committerMatthew Newhook <matthew@zeroc.com>2014-10-03 15:34:33 -0230
commitb530efc5ccfb6c2b6e096933431f1f1827851996 (patch)
tree32436ff41466bb7339d250477cda3a4ec7708075 /cpp/src/Ice/Instance.cpp
parentICE-5613 - Systemd service support (diff)
downloadice-b530efc5ccfb6c2b6e096933431f1f1827851996.tar.bz2
ice-b530efc5ccfb6c2b6e096933431f1f1827851996.tar.xz
ice-b530efc5ccfb6c2b6e096933431f1f1827851996.zip
- Java Application now catches OperationInterruptedException and
retries. - Removed the InProgress state from Instance, simplified and corrected the destroy logic.
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 2157b7704b5..db5265ac0db 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -1628,27 +1628,6 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
void
IceInternal::Instance::destroy()
{
- {
- IceUtil::RecMutex::Lock sync(*this);
-
- //
- // If the _state is not StateActive then the instance is
- // either being destroyed, or has already been destroyed.
- //
- if(_state != StateActive)
- {
- return;
- }
-
- //
- // We cannot set state to StateDestroyed otherwise instance
- // methods called during the destroy process (such as
- // outgoingConnectionFactory() from
- // ObjectAdapterI::deactivate() will cause an exception.
- //
- _state = StateDestroyInProgress;
- }
-
if(_objectAdapterFactory)
{
_objectAdapterFactory->shutdown();
@@ -1697,6 +1676,7 @@ IceInternal::Instance::destroy()
ThreadPoolPtr clientThreadPool;
EndpointHostResolverPtr endpointHostResolver;
TimerPtr timer;
+ bool checkUnused = false;
{
IceUtil::RecMutex::Lock sync(*this);
@@ -1769,6 +1749,10 @@ IceInternal::Instance::destroy()
_adminAdapter = 0;
_adminFacets.clear();
+ if(_state != StateDestroyed)
+ {
+ checkUnused = true;
+ }
_state = StateDestroyed;
}
@@ -1794,7 +1778,7 @@ IceInternal::Instance::destroy()
}
#endif
- if(_initData.properties->getPropertyAsInt("Ice.Warn.UnusedProperties") > 0)
+ if(checkUnused && _initData.properties->getPropertyAsInt("Ice.Warn.UnusedProperties") > 0)
{
set<string> unusedProperties = static_cast<PropertiesI*>(_initData.properties.get())->getUnusedProperties();
if(unusedProperties.size() != 0)