From 356e14707a342da8102b731503c8f2628c1cc79b Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 25 Sep 2014 12:24:57 +0200 Subject: Fixed ICE-5687 - adapterDeactivation test warnings --- cpp/src/Ice/ProxyFactory.cpp | 10 ++++++++++ cpp/src/Ice/RetryQueue.cpp | 5 +++++ cpp/src/Ice/RetryQueue.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp index b38e281622a..68ca8b02598 100644 --- a/cpp/src/Ice/ProxyFactory.cpp +++ b/cpp/src/Ice/ProxyFactory.cpp @@ -210,6 +210,16 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co ex.ice_throw(); } + // + // Don't retry if the communicator is destroyed or object adapter + // deactivated. + // + if(dynamic_cast(&ex) || + dynamic_cast(&ex)) + { + ex.ice_throw(); + } + // // Don't retry invocation timeouts. // diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp index 730b15ba73d..785a650f7f0 100644 --- a/cpp/src/Ice/RetryQueue.cpp +++ b/cpp/src/Ice/RetryQueue.cpp @@ -52,6 +52,10 @@ void IceInternal::RetryQueue::add(const OutgoingAsyncMessageCallbackPtr& out, int interval) { Lock sync(*this); + if(!_instance) + { + throw CommunicatorDestroyedException(__FILE__, __LINE__); + } RetryTaskPtr task = new RetryTask(this, out); try { @@ -68,6 +72,7 @@ void IceInternal::RetryQueue::destroy() { Lock sync(*this); + _instance = 0; for(set::const_iterator p = _requests.begin(); p != _requests.end(); ++p) { _instance->timer()->cancel(*p); diff --git a/cpp/src/Ice/RetryQueue.h b/cpp/src/Ice/RetryQueue.h index 4339a7765b2..07307310c8d 100644 --- a/cpp/src/Ice/RetryQueue.h +++ b/cpp/src/Ice/RetryQueue.h @@ -52,7 +52,7 @@ private: bool remove(const RetryTaskPtr&); friend class RetryTask; - const InstancePtr _instance; + InstancePtr _instance; std::set _requests; }; -- cgit v1.2.3