aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-09-09 08:33:35 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-09-09 08:33:35 -0700
commit7309664d032c82724c12e79d8cbb2e18d842598e (patch)
tree58e18e85e57320f608fb30c39f2b9da2a61bb53b /src
parent0e48a9af490c5c48802ca1f3faab36e022cfca49 (diff)
Avoid circular refcounting.
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.c11
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.c9
2 files changed, 1 insertions, 19 deletions
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
index 550080c7d5..5b9101e018 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
@@ -160,7 +160,6 @@ typedef struct {
grpc_client_channel_factory base;
gpr_refcount refs;
grpc_channel_args *merge_args;
- grpc_channel *master;
} client_channel_factory;
static void client_channel_factory_ref(
@@ -173,10 +172,6 @@ static void client_channel_factory_unref(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory) {
client_channel_factory *f = (client_channel_factory *)cc_factory;
if (gpr_unref(&f->refs)) {
- if (f->master != NULL) {
- GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, f->master,
- "client_channel_factory");
- }
grpc_channel_args_destroy(f->merge_args);
gpr_free(f);
}
@@ -250,12 +245,8 @@ grpc_channel *grpc_insecure_channel_create(const char *target,
grpc_channel *channel = client_channel_factory_create_channel(
&exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL);
- if (channel != NULL) {
- f->master = channel;
- GRPC_CHANNEL_INTERNAL_REF(f->master, "grpc_insecure_channel_create");
- }
- grpc_client_channel_factory_unref(&exec_ctx, &f->base);
+ grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_exec_ctx_finish(&exec_ctx);
return channel != NULL ? channel : grpc_lame_client_channel_create(
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
index 3285dbf612..da738138b5 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
@@ -220,7 +220,6 @@ typedef struct {
gpr_refcount refs;
grpc_channel_args *merge_args;
grpc_channel_security_connector *security_connector;
- grpc_channel *master;
} client_channel_factory;
static void client_channel_factory_ref(
@@ -235,10 +234,6 @@ static void client_channel_factory_unref(
if (gpr_unref(&f->refs)) {
GRPC_SECURITY_CONNECTOR_UNREF(&f->security_connector->base,
"client_channel_factory");
- if (f->master != NULL) {
- GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, f->master,
- "client_channel_factory");
- }
grpc_channel_args_destroy(f->merge_args);
gpr_free(f);
}
@@ -356,10 +351,6 @@ grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
grpc_channel *channel = client_channel_factory_create_channel(
&exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL);
- if (channel != NULL) {
- f->master = channel;
- GRPC_CHANNEL_INTERNAL_REF(f->master, "grpc_secure_channel_create");
- }
grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_exec_ctx_finish(&exec_ctx);