From 3eb96489f4e88a7246699c00bf9ae9c7e78a8294 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 21 May 2021 11:14:44 -0700 Subject: [PATCH] Don't instantiate ExecCtx in channel_args destructor unless needed (#26332) --- src/cpp/common/channel_arguments.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc index e342e8d6a4a..2eb280931d6 100644 --- a/src/cpp/common/channel_arguments.cc +++ b/src/cpp/common/channel_arguments.cc @@ -66,9 +66,9 @@ ChannelArguments::ChannelArguments(const ChannelArguments& other) } ChannelArguments::~ChannelArguments() { - grpc_core::ExecCtx exec_ctx; for (auto& arg : args_) { if (arg.type == GRPC_ARG_POINTER) { + grpc_core::ExecCtx exec_ctx; arg.value.pointer.vtable->destroy(arg.value.pointer.p); } }