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/Glacier2Lib/SessionHelper.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/Glacier2Lib/SessionHelper.cpp')
-rw-r--r-- | cpp/src/Glacier2Lib/SessionHelper.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index 85c513a7081..bc0f625d503 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -507,21 +507,40 @@ public: _callback(callback), _session(session) { +#ifdef ICE_CPP11_MAPPING + _ex = ex.ice_clone(); +#else _ex.reset(ex.ice_clone()); +#endif } virtual void run() { +#ifdef ICE_CPP11_MAPPING + try + { + rethrow_exception(_ex); + } + catch(const Ice::Exception& ex) + { + _callback->connectFailed(_session, ex); + } +#else const Ice::Exception* ex(_ex.get()); _callback->connectFailed(_session, *ex); +#endif } private: const Glacier2::SessionCallbackPtr _callback; const Glacier2::SessionHelperPtr _session; +#ifdef ICE_CPP11_MAPPING + std::exception_ptr _ex; +#else IceUtil::UniquePtr<Ice::Exception> _ex; +#endif }; class CreatedCommunicator : public Ice::DispatcherCall |