summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-09-25 12:24:57 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-09-25 12:24:57 +0200
commit356e14707a342da8102b731503c8f2628c1cc79b (patch)
treeb15b837cad964f6ab3a66670ac6eb89a1d832677 /cpp/src
parentFixed compilation problem with Ruby on OS X (diff)
downloadice-356e14707a342da8102b731503c8f2628c1cc79b.tar.bz2
ice-356e14707a342da8102b731503c8f2628c1cc79b.tar.xz
ice-356e14707a342da8102b731503c8f2628c1cc79b.zip
Fixed ICE-5687 - adapterDeactivation test warnings
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ProxyFactory.cpp10
-rw-r--r--cpp/src/Ice/RetryQueue.cpp5
-rw-r--r--cpp/src/Ice/RetryQueue.h2
3 files changed, 16 insertions, 1 deletions
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
@@ -211,6 +211,16 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, co
}
//
+ // Don't retry if the communicator is destroyed or object adapter
+ // deactivated.
+ //
+ if(dynamic_cast<const CommunicatorDestroyedException*>(&ex) ||
+ dynamic_cast<const ObjectAdapterDeactivatedException*>(&ex))
+ {
+ ex.ice_throw();
+ }
+
+ //
// Don't retry invocation timeouts.
//
if(dynamic_cast<const InvocationTimeoutException*>(&ex))
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<RetryTaskPtr>::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<RetryTaskPtr> _requests;
};