aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/iomgr.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-24 15:00:58 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-24 15:00:58 -0700
commit6301038bfc929eab09f8b744096166623e69f64f (patch)
treeecd3425bcab88773cff96d516b366f0c7313e334 /src/core/iomgr/iomgr.c
parent8dc09711330ad675d90021e1a7c525cc57d3d956 (diff)
Fix some bugs leading to memory leaks
Diffstat (limited to 'src/core/iomgr/iomgr.c')
-rw-r--r--src/core/iomgr/iomgr.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index ef222416af..612419b70e 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -105,28 +105,25 @@ void grpc_iomgr_shutdown(void) {
if (grpc_alarm_check(&exec_ctx, gpr_inf_future(GPR_CLOCK_MONOTONIC),
NULL)) {
gpr_mu_unlock(&g_mu);
- grpc_exec_ctx_finish(&exec_ctx);
+ grpc_exec_ctx_flush(&exec_ctx);
gpr_mu_lock(&g_mu);
continue;
}
if (g_root_object.next != &g_root_object) {
- int timeout = 0;
gpr_timespec short_deadline = gpr_time_add(
gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(100, GPR_TIMESPAN));
if (gpr_cv_wait(&g_rcv, &g_mu, short_deadline)) {
if (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), shutdown_deadline) > 0) {
- timeout = 1;
+ if (g_root_object.next != &g_root_object) {
+ gpr_log(GPR_DEBUG,
+ "Failed to free %d iomgr objects before shutdown deadline: "
+ "memory leaks are likely",
+ count_objects());
+ dump_objects("LEAKED");
+ }
break;
}
}
- if (timeout && g_root_object.next != &g_root_object) {
- gpr_log(GPR_DEBUG,
- "Failed to free %d iomgr objects before shutdown deadline: "
- "memory leaks are likely",
- count_objects());
- dump_objects("LEAKED");
- break;
- }
}
}
gpr_mu_unlock(&g_mu);