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/slice2cpp/Gen.cpp | |
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/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
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; } } |