Merge pull request #19180 from karthikravis/revert-19175-revert-18813-callback-rpc-lock

Fix the memory leak.
pull/19178/head
Karthik Ravi Shankar 6 years ago committed by GitHub
commit fb1170eaf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/lib/surface/completion_queue.cc

@ -820,6 +820,7 @@ static void cq_end_op_for_pluck(
static void functor_callback(void* arg, grpc_error* error) {
auto* functor = static_cast<grpc_experimental_completion_queue_functor*>(arg);
functor->functor_run(functor, error == GRPC_ERROR_NONE);
GRPC_ERROR_UNREF(error);
}
/* Complete an event on a completion queue of type GRPC_CQ_CALLBACK */
@ -860,14 +861,14 @@ static void cq_end_op_for_callback(
if (internal) {
grpc_core::ApplicationCallbackExecCtx::Enqueue(functor,
(error == GRPC_ERROR_NONE));
GRPC_ERROR_UNREF(error);
} else {
GRPC_CLOSURE_SCHED(
GRPC_CLOSURE_CREATE(
functor_callback, functor,
grpc_core::Executor::Scheduler(grpc_core::ExecutorJobType::SHORT)),
GRPC_ERROR_REF(error));
error);
}
GRPC_ERROR_UNREF(error);
}
void grpc_cq_end_op(grpc_completion_queue* cq, void* tag, grpc_error* error,
@ -1356,7 +1357,7 @@ static void cq_finish_shutdown_callback(grpc_completion_queue* cq) {
GRPC_CLOSURE_CREATE(
functor_callback, callback,
grpc_core::Executor::Scheduler(grpc_core::ExecutorJobType::SHORT)),
GRPC_ERROR_NONE);
GRPC_ERROR_REF(GRPC_ERROR_NONE));
}
static void cq_shutdown_callback(grpc_completion_queue* cq) {

Loading…
Cancel
Save