From 7d1491d64c9b6279233c780d290c514a7040c1c7 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 7 Jan 2019 09:23:35 -0800 Subject: Address reviewer comments --- include/grpcpp/impl/codegen/call_op_set.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h index e8a4d389f1..ced0b2ff3e 100644 --- a/include/grpcpp/impl/codegen/call_op_set.h +++ b/include/grpcpp/impl/codegen/call_op_set.h @@ -321,6 +321,7 @@ class CallOpSendMessage { if (msg_ != nullptr) { GPR_CODEGEN_ASSERT(serializer_(msg_).ok()); } + serializer_ = nullptr; grpc_op* op = &ops[(*nops)++]; op->op = GRPC_OP_SEND_MESSAGE; op->flags = write_options_.flags(); @@ -361,13 +362,13 @@ class CallOpSendMessage { template Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) { write_options_ = options; - // TODO(vjpai): Remove the void below when possible - // The void in the template parameter below should not be needed - // (since it should be implicit) but is needed due to an observed - // difference in behavior between clang and gcc for certain internal users serializer_ = [this](const void* message) { bool own_buf; send_buf_.Clear(); + // TODO(vjpai): Remove the void below when possible + // The void in the template parameter below should not be needed + // (since it should be implicit) but is needed due to an observed + // difference in behavior between clang and gcc for certain internal users Status result = SerializationTraits::Serialize( *static_cast(message), send_buf_.bbuf_ptr(), &own_buf); if (!own_buf) { -- cgit v1.2.3