diff options
author | Mark Spruiell <mes@zeroc.com> | 2013-07-08 16:17:45 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2013-07-08 16:17:45 -0700 |
commit | a730826e277b632d002b649fa9de2c6517261e6c (patch) | |
tree | def4940768b03efbc4faea995c2be9d95744c1bd /cpp | |
parent | minor - getMesssage could be null in connectionRefused implementation. (diff) | |
download | ice-a730826e277b632d002b649fa9de2c6517261e6c.tar.bz2 ice-a730826e277b632d002b649fa9de2c6517261e6c.tar.xz ice-a730826e277b632d002b649fa9de2c6517261e6c.zip |
ICE-5338 - null reference error in metrics
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 74 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.h | 4 |
2 files changed, 54 insertions, 24 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index b682ce39cff..8997a0d6619 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -114,6 +114,11 @@ public: Init init; +} + +namespace IceInternal +{ + class ObserverUpdaterI : public Ice::Instrumentation::ObserverUpdater { public: @@ -124,33 +129,12 @@ public: void updateConnectionObservers() { - try - { - _instance->outgoingConnectionFactory()->updateConnectionObservers(); - _instance->objectAdapterFactory()->updateObservers(&ObjectAdapterI::updateConnectionObservers); - } - catch(const Ice::CommunicatorDestroyedException&) - { - } + _instance->updateConnectionObservers(); } void updateThreadObservers() { - try - { - _instance->clientThreadPool()->updateObservers(); - ThreadPoolPtr serverThreadPool = _instance->serverThreadPool(false); - if(serverThreadPool) - { - serverThreadPool->updateObservers(); - } - _instance->objectAdapterFactory()->updateObservers(&ObjectAdapterI::updateThreadObservers); - _instance->endpointHostResolver()->updateObserver(); - theCollector->updateObserver(_instance->initializationData().observer); - } - catch(const Ice::CommunicatorDestroyedException&) - { - } + _instance->updateThreadObservers(); } private: @@ -1388,7 +1372,7 @@ IceInternal::Instance::destroy() _retryQueue->destroy(); } - if(_initData.observer) + if(_initData.observer && theCollector) { theCollector->clearObserver(_initData.observer); } @@ -1522,6 +1506,48 @@ IceInternal::Instance::destroy() return true; } +void +IceInternal::Instance::updateConnectionObservers() +{ + try + { + assert(_outgoingConnectionFactory); + _outgoingConnectionFactory->updateConnectionObservers(); + assert(_objectAdapterFactory); + _objectAdapterFactory->updateObservers(&ObjectAdapterI::updateConnectionObservers); + } + catch(const Ice::CommunicatorDestroyedException&) + { + } +} + +void +IceInternal::Instance::updateThreadObservers() +{ + try + { + if(_clientThreadPool) + { + _clientThreadPool->updateObservers(); + } + if(_serverThreadPool) + { + _serverThreadPool->updateObservers(); + } + assert(_objectAdapterFactory); + _objectAdapterFactory->updateObservers(&ObjectAdapterI::updateThreadObservers); + if(_endpointHostResolver) + { + _endpointHostResolver->updateObserver(); + } + assert(theCollector); + theCollector->updateObserver(_initData.observer); + } + catch(const Ice::CommunicatorDestroyedException&) + { + } +} + IceInternal::ProcessI::ProcessI(const CommunicatorPtr& communicator) : _communicator(communicator) { diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index d092e49dc3d..16aa25648b0 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -115,6 +115,10 @@ private: bool destroy(); friend class Ice::CommunicatorI; + void updateConnectionObservers(); + void updateThreadObservers(); + friend class ObserverUpdaterI; + enum State { StateActive, |