diff options
author | Jose <jose@zeroc.com> | 2016-01-08 21:10:14 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-08 21:10:14 +0100 |
commit | 93ab5a8f08970ad49c6f973b965b8fbefb63882f (patch) | |
tree | 18c00abdc514ca90a7ab6e1acc5b350847843681 /cpp/src/Ice/Reference.cpp | |
parent | C++98 test minor build fix (diff) | |
download | ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.bz2 ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.tar.xz ice-93ab5a8f08970ad49c6f973b965b8fbefb63882f.zip |
C++11 fix Exception::ice_clone to use exception_ptr
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index e2b36e92ffa..bc635c8e0a9 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1773,6 +1773,25 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all virtual void setException(const Ice::LocalException& ex) { +#ifdef ICE_CPP11_MAPPING + if(!_exception) + { + _exception = ex.ice_clone(); + } + + try + { + rethrow_exception(_exception); + } + catch(const Ice::LocalException& ee) + { + if(++_i == _endpoints.size()) + { + _callback->setException(ee); + return; + } + } +#else if(!_exception.get()) { _exception.reset(ex.ice_clone()); @@ -1783,7 +1802,7 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all _callback->setException(*_exception.get()); return; } - +#endif const bool more = _i != _endpoints.size() - 1; vector<EndpointIPtr> endpoint; endpoint.push_back(_endpoints[_i]); @@ -1807,7 +1826,11 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all const vector<EndpointIPtr> _endpoints; const GetConnectionCallbackPtr _callback; size_t _i; +#ifdef ICE_CPP11_MAPPING + std::exception_ptr _exception; +#else IceUtil::UniquePtr<Ice::LocalException> _exception; +#endif }; // |