Delay call context destruction (#26798)

pull/26853/head
Yash Tibrewal 3 years ago committed by GitHub
parent b22a8ce9c4
commit bc09e792c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/core/lib/surface/call.cc

@ -151,6 +151,11 @@ struct grpc_call {
}
~grpc_call() {
for (int i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
if (context[i].destroy) {
context[i].destroy(context[i].value);
}
}
gpr_free(static_cast<void*>(const_cast<char*>(final_info.error_string)));
}
@ -554,11 +559,6 @@ static void destroy_call(void* call, grpc_error_handle /*error*/) {
for (ii = 0; ii < c->send_extra_metadata_count; ii++) {
GRPC_MDELEM_UNREF(c->send_extra_metadata[ii].md);
}
for (i = 0; i < GRPC_CONTEXT_COUNT; i++) {
if (c->context[i].destroy) {
c->context[i].destroy(c->context[i].value);
}
}
if (c->cq) {
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
}

Loading…
Cancel
Save