From dbf8fdc07396e466ad53bd4c54430660212b585c Mon Sep 17 00:00:00 2001
From: Yang Gao <yangg@google.com>
Date: Thu, 28 May 2015 00:52:31 -0700
Subject: [PATCH] Unref the slices if no write will happen.

---
 src/core/channel/client_channel.c | 1 +
 src/core/surface/lame_client.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c
index 78f8d06d89..42e242ae81 100644
--- a/src/core/channel/client_channel.c
+++ b/src/core/channel/client_channel.c
@@ -144,6 +144,7 @@ static void handle_op_after_cancellation(grpc_call_element *elem,
   call_data *calld = elem->call_data;
   channel_data *chand = elem->channel_data;
   if (op->send_ops) {
+    grpc_stream_ops_unref_owned_objects(op->send_ops->ops, op->send_ops->nops);
     op->on_done_send(op->send_user_data, 0);
   }
   if (op->recv_ops) {
diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c
index 3186292a02..a3b0b2672b 100644
--- a/src/core/surface/lame_client.c
+++ b/src/core/surface/lame_client.c
@@ -55,6 +55,7 @@ static void lame_start_transport_op(grpc_call_element *elem,
   channel_data *chand = elem->channel_data;
   GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
   if (op->send_ops) {
+    grpc_stream_ops_unref_owned_objects(op->send_ops->ops, op->send_ops->nops);
     op->on_done_send(op->send_user_data, 0);
   }
   if (op->recv_ops) {
-- 
GitLab