diff options
author | Yuchen Zeng <zyc@google.com> | 2017-03-21 11:57:57 -0700 |
---|---|---|
committer | Yuchen Zeng <zyc@google.com> | 2017-03-21 11:57:57 -0700 |
commit | eb799b78b3b260722a74bfcaa14b43ecaa9341ae (patch) | |
tree | 9afc66da751c07f72aab79874231421826d8004f /src/core/ext/resolver | |
parent | 7496218b9e338291d735554b3586d3a3f30fb30b (diff) |
Fix shutdown process on macos
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r-- | src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c b/src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c index 379df63b8e..d8369817b1 100644 --- a/src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c +++ b/src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c @@ -332,7 +332,13 @@ void grpc_resolver_dns_ares_init(void) { gpr_free(resolver); } -void grpc_resolver_dns_ares_shutdown(void) { grpc_ares_cleanup(); } +void grpc_resolver_dns_ares_shutdown(void) { + char *resolver = gpr_getenv("GRPC_DNS_RESOLVER"); + if (resolver != NULL && gpr_stricmp(resolver, "ares") == 0) { + grpc_ares_cleanup(); + } + gpr_free(resolver); +} #else /* GRPC_ARES == 1 && !defined(GRPC_UV) */ |