aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/client_channel/proxy_mapper_registry.c
diff options
context:
space:
mode:
authorGravatar Makarand Dharmapurikar <makarandd@google.com>2017-03-27 09:18:21 -0700
committerGravatar Makarand Dharmapurikar <makarandd@google.com>2017-03-27 09:18:21 -0700
commita0649dde0ec92624d56f943d3b0fae09bcb65e5b (patch)
tree8b0885a3e6d7584b79b5a31725932f4c606768a1 /src/core/ext/client_channel/proxy_mapper_registry.c
parent3c7e460de68625c926b8e4581ed573e543a16a67 (diff)
parentc4478a103b68100b86f506061cedcb0ce70016ba (diff)
Merge branch 'master' of https://github.com/grpc/grpc into grpcz_client
Diffstat (limited to 'src/core/ext/client_channel/proxy_mapper_registry.c')
-rw-r--r--src/core/ext/client_channel/proxy_mapper_registry.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/ext/client_channel/proxy_mapper_registry.c b/src/core/ext/client_channel/proxy_mapper_registry.c
index 2c44b9d490..0935ddbdbd 100644
--- a/src/core/ext/client_channel/proxy_mapper_registry.c
+++ b/src/core/ext/client_channel/proxy_mapper_registry.c
@@ -94,6 +94,14 @@ static void grpc_proxy_mapper_list_destroy(grpc_proxy_mapper_list* list) {
grpc_proxy_mapper_destroy(list->list[i]);
}
gpr_free(list->list);
+ // Clean up in case we re-initialze later.
+ // TODO(ctiller): This should ideally live in
+ // grpc_proxy_mapper_registry_init(). However, if we did this there,
+ // then we would do it AFTER we start registering proxy mappers from
+ // third-party plugins, so they'd never show up (and would leak memory).
+ // We probably need some sort of dependency system for plugins to fix
+ // this.
+ memset(list, 0, sizeof(*list));
}
//
@@ -102,9 +110,7 @@ static void grpc_proxy_mapper_list_destroy(grpc_proxy_mapper_list* list) {
static grpc_proxy_mapper_list g_proxy_mapper_list;
-void grpc_proxy_mapper_registry_init() {
- memset(&g_proxy_mapper_list, 0, sizeof(g_proxy_mapper_list));
-}
+void grpc_proxy_mapper_registry_init() {}
void grpc_proxy_mapper_registry_shutdown() {
grpc_proxy_mapper_list_destroy(&g_proxy_mapper_list);