summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-17 17:52:44 +0100
committerJose <jose@zeroc.com>2015-12-17 17:52:44 +0100
commit061e8b03290cd88b14943b30a372a28f3a7365e0 (patch)
tree0a0a2b10b9fc1f835c6ada152049d6848a92a28f /cpp/src
parentFix Python Ice/slicing/objects test (diff)
downloadice-061e8b03290cd88b14943b30a372a28f3a7365e0.tar.bz2
ice-061e8b03290cd88b14943b30a372a28f3a7365e0.tar.xz
ice-061e8b03290cd88b14943b30a372a28f3a7365e0.zip
C++11 DispatchInterceptor fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/IncomingAsync.cpp20
-rw-r--r--cpp/src/Ice/Object.cpp1
-rw-r--r--cpp/src/slice2cpp/Gen.cpp2
3 files changed, 21 insertions, 2 deletions
diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp
index 3b4820cdbbb..835963b9c0d 100644
--- a/cpp/src/Ice/IncomingAsync.cpp
+++ b/cpp/src/Ice/IncomingAsync.cpp
@@ -64,12 +64,32 @@ IceInternal::IncomingAsync::IncomingAsync(Incoming& in) :
_retriable(in.isRetriable()),
_active(true)
{
+#ifndef ICE_CPP11_MAPPING
if(_retriable)
{
+ //
+ // With C++11 maping we cannot call setActive from the ctor as
+ // it creates a smart pointer to this object, and with shared_ptr
+ // this requires a fully constructed object.
+ //
in.setActive(*this);
}
+#endif
}
+#ifdef ICE_CPP11_MAPPING
+IncomingAsyncPtr
+IceInternal::IncomingAsync::create(Incoming& in)
+{
+ IncomingAsyncPtr self(new IncomingAsync(in));
+ if(in.isRetriable())
+ {
+ in.setActive(*self.get());
+ }
+ return self;
+}
+#endif
+
void
IceInternal::IncomingAsync::__deactivate(Incoming& in)
{
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
index 7378d7e4e75..a4d28141c6e 100644
--- a/cpp/src/Ice/Object.cpp
+++ b/cpp/src/Ice/Object.cpp
@@ -182,7 +182,6 @@ Ice::Object::ice_dispatch(Request& request, const DispatchInterceptorAsyncCallba
IceInternal::Incoming& in = dynamic_cast<IceInternal::IncomingRequest&>(request)._in;
-
PushCb pusbCb(in, cb);
in.startOver(); // may raise ResponseSentException
return __dispatch(in, in.getCurrent());
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 9b3567b0c59..e34d25b5361 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -8255,7 +8255,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p)
}
else
{
- C << nl << "auto inS = ::std::make_shared<::IceInternal::IncomingAsync>(__inS);";
+ C << nl << "auto inS = ::IceInternal::IncomingAsync::create(__inS);";
C << nl << "auto __exception = [inS](::std::exception_ptr e)";
C << sb;
C << nl << "try";