Fix bug in addr sorting shutdonw

pull/15123/head
Alexander Polcyn 7 years ago
parent 6f3cadb687
commit 046ad6b13f
  1. 10
      test/cpp/naming/address_sorting_test.cc
  2. 1
      third_party/address_sorting/address_sorting.c

@ -722,16 +722,24 @@ TEST(AddressSortingTest, TestStableSortV4CompatAndSiteLocalAddresses) {
}
int main(int argc, char** argv) {
const char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (resolver == nullptr || strlen(resolver) == 0) {
gpr_setenv("GRPC_DNS_RESOLVER", "ares");
} else if (strcmp("ares", resolver)) {
gpr_log(GPR_INFO, "GRPC_DNS_RESOLVER != ares: %s.", resolver);
}
gpr_free(resolver);
grpc_test_init(argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
auto result = RUN_ALL_TESTS();
grpc_shutdown();
// Test sequential and nested inits and shutdowns.
grpc_init();
grpc_init();
grpc_shutdown();
grpc_shutdown();
grpc_init();
grpc_shutdown();
return result;
}

@ -366,4 +366,5 @@ void address_sorting_shutdown() {
abort();
}
g_current_source_addr_factory->vtable->destroy(g_current_source_addr_factory);
g_current_source_addr_factory = NULL;
}

Loading…
Cancel
Save