Fix memory leak

pull/1888/head
Craig Tiller 10 years ago
parent 12d7e1f306
commit 7ae5a38ec0
  1. 6
      src/core/surface/call.c

@ -270,7 +270,7 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
call->channel = channel;
call->cq = cq;
if (cq) {
grpc_cq_internal_ref(cq);
GRPC_CQ_INTERNAL_REF(cq, "bind");
}
call->is_client = server_transport_data == NULL;
for (i = 0; i < GRPC_IOREQ_OP_COUNT; i++) {
@ -321,7 +321,7 @@ void grpc_call_set_completion_queue(grpc_call *call,
lock(call);
call->cq = cq;
if (cq) {
grpc_cq_internal_ref(cq);
GRPC_CQ_INTERNAL_REF(cq, "bind");
}
unlock(call);
}
@ -371,7 +371,7 @@ static void destroy_call(void *call, int ignored_success) {
grpc_bbq_destroy(&c->incoming_queue);
gpr_slice_buffer_destroy(&c->incoming_message);
if (c->cq) {
grpc_cq_internal_ref(c->cq);
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
}
gpr_free(c);
}

Loading…
Cancel
Save