pull/36509/head
Craig Tiller 10 months ago
parent 36e826c48c
commit d36515a207
  1. 5
      src/core/lib/surface/call.cc

@ -3176,10 +3176,11 @@ class ServerCall final : public Call, public DualRefCounted<ServerCall> {
void CancelWithError(grpc_error_handle error) override { void CancelWithError(grpc_error_handle error) override {
call_handler_.SpawnInfallible( call_handler_.SpawnInfallible(
"CancelWithError", [this, error = std::move(error)] { "CancelWithError",
[self = WeakRefAsSubclass<ServerCall>(), error = std::move(error)] {
auto status = ServerMetadataFromStatus(error); auto status = ServerMetadataFromStatus(error);
status->Set(GrpcCallWasCancelled(), true); status->Set(GrpcCallWasCancelled(), true);
call_handler_.PushServerTrailingMetadata(std::move(status)); self->call_handler_.PushServerTrailingMetadata(std::move(status));
return Empty{}; return Empty{};
}); });
} }

Loading…
Cancel
Save