diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-01-22 18:24:53 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-01-22 18:24:53 +0000 |
commit | 41bad21fe66824897ec0c01feb5b445b72cbd929 (patch) | |
tree | daa871238cd9e56f20844d225981b34d4bf52156 /cpp/src | |
parent | Fixed BCC compiler issue (diff) | |
download | ice-41bad21fe66824897ec0c01feb5b445b72cbd929.tar.bz2 ice-41bad21fe66824897ec0c01feb5b445b72cbd929.tar.xz ice-41bad21fe66824897ec0c01feb5b445b72cbd929.zip |
Fixed bug 1684, 1685
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Direct.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 52 | ||||
-rw-r--r-- | cpp/src/IceGrid/Internal.ice | 7 | ||||
-rw-r--r-- | cpp/src/IceGrid/Parser.cpp | 1 | ||||
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 2 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 27 |
6 files changed, 76 insertions, 21 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp index dc8aae9dcd9..d27825ab907 100644 --- a/cpp/src/Ice/Direct.cpp +++ b/cpp/src/Ice/Direct.cpp @@ -91,8 +91,14 @@ IceInternal::Direct::Direct(const Current& current) : } } -IceInternal::Direct::~Direct() +void +IceInternal::Direct::destroy() { + // + // NOTE: we can't do the following in the destructor because it + // might throw. + // + ObjectAdapterI* adapter = dynamic_cast<ObjectAdapterI*>(_current.adapter.get()); assert(adapter); diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index bbf9095fea5..556fdf4dbfd 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -1291,7 +1291,18 @@ IceDelegateD::Ice::Object::ice_isA(const string& __id, const Context* context) while(true) { Direct __direct(__current); - return __direct.servant()->ice_isA(__id, __current); + bool __ret; + try + { + __ret = __direct.servant()->ice_isA(__id, __current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return false; // To keep the Visual C++ compiler happy. } @@ -1304,8 +1315,17 @@ IceDelegateD::Ice::Object::ice_ping(const ::Ice::Context* context) while(true) { Direct __direct(__current); - __direct.servant()->ice_ping(__current); - return; + try + { + __direct.servant()->ice_ping(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return; } } @@ -1317,7 +1337,18 @@ IceDelegateD::Ice::Object::ice_ids(const ::Ice::Context* context) while(true) { Direct __direct(__current); - return __direct.servant()->ice_ids(__current); + vector<string> __ret; + try + { + __ret = __direct.servant()->ice_ids(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return vector<string>(); // To keep the Visual C++ compiler happy. } @@ -1330,7 +1361,18 @@ IceDelegateD::Ice::Object::ice_id(const ::Ice::Context* context) while(true) { Direct __direct(__current); - return __direct.servant()->ice_id(__current); + string __ret; + try + { + __ret = __direct.servant()->ice_id(__current); + } + catch(...) + { + __direct.destroy(); + throw; + } + __direct.destroy(); + return __ret; } return string(); // To keep the Visual C++ compiler happy. } diff --git a/cpp/src/IceGrid/Internal.ice b/cpp/src/IceGrid/Internal.ice index 2639d080b49..da569db2803 100644 --- a/cpp/src/IceGrid/Internal.ice +++ b/cpp/src/IceGrid/Internal.ice @@ -667,13 +667,6 @@ class InternalReplicaInfo * **/ string hostname; - - /** - * - * The client endpoints of the registry. - * - **/ - string endpoints; }; interface InternalRegistry extends FileReader diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index 4a44714d460..fba0141d978 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -830,7 +830,6 @@ Parser::describeRegistry(const list<string>& args) out << "registry `" << args.front() << "'"; out << sb; out << nl << "host name = `" << info.hostname << "'"; - out << nl << "endpoints = `" << info.endpoints << "'"; out << eb; out << nl; } diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index 5d448ea7e3e..d2b2e813997 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -73,7 +73,6 @@ toRegistryInfo(const InternalReplicaInfoPtr& replica) RegistryInfo info; info.name = replica->name; info.hostname = replica->hostname; - info.endpoints = replica->endpoints; return info; } @@ -310,7 +309,6 @@ PlatformInfo::getInternalReplicaInfo() const InternalReplicaInfoPtr info = new InternalReplicaInfo(); info->name = _name; info->hostname = _hostname; - info->endpoints = _endpoints; return info; } diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 33ebc0757cf..1d3dbf6f8f5 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2588,6 +2588,12 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p) C << nl << "while(true)"; C << sb; C << nl << "::IceInternal::Direct __direct(__current);"; + if(ret) + { + C << nl << retS << " __ret;"; + } + C << nl << "try"; + C << sb; C << nl << thisPointer << " __servant = dynamic_cast< " << thisPointer << ">(__direct.servant().get());"; C << nl << "if(!__servant)"; C << sb; @@ -2602,19 +2608,30 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p) C << nl; if(ret) { - C << "return "; + C << "__ret = "; } C << "__servant->" << name << spar << args << epar << ';'; - if(!ret) - { - C << nl << "return;"; - } C << eb; C << nl << "catch(const ::Ice::LocalException& __ex)"; C << sb; C << nl << "throw ::IceInternal::LocalExceptionWrapper(__ex, false);"; C << eb; C << eb; + C << nl << "catch(...)"; + C << sb; + C << nl << "__direct.destroy();"; + C << nl << "throw;"; + C << eb; + C << nl << "__direct.destroy();"; + if(ret) + { + C << nl << "return __ret;"; + } + else + { + C << nl << "return;"; + } + C << eb; C << eb; } } |