diff --git a/include/grpcpp/impl/codegen/async_unary_call.h b/include/grpcpp/impl/codegen/async_unary_call.h index d7a3b57314a..7928e316a3e 100644 --- a/include/grpcpp/impl/codegen/async_unary_call.h +++ b/include/grpcpp/impl/codegen/async_unary_call.h @@ -334,6 +334,10 @@ class ServerAsyncResponseWriter final /// Note: if \a status has a non-OK code, then \a msg will not be sent, /// and the client will receive only the status with possible trailing /// metadata. + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). void Finish(const W& msg, const ::grpc::Status& status, void* tag) { finish_buf_.set_output_tag(tag); finish_buf_.set_core_cq_tag(&finish_buf_); @@ -367,6 +371,10 @@ class ServerAsyncResponseWriter final /// Side effect: /// - also sends initial metadata if not already sent (using the /// \a ServerContext associated with this call). + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). void FinishWithError(const ::grpc::Status& status, void* tag) { GPR_CODEGEN_ASSERT(!status.ok()); finish_buf_.set_output_tag(tag);