aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-04-21 15:10:00 -0700
committerGravatar GitHub <noreply@github.com>2018-04-21 15:10:00 -0700
commit6abc0aef5d07bb55477c2f59c4793f3452e51efc (patch)
tree9d18592d203416d385b2c4f483dab0a7b3595ddc /src/core/lib/iomgr
parent98a56a2951df259c9a6ec2d21b4398f1d924b5e9 (diff)
parent9d00766d5a5e4a7266a35ff50ebdf084e1517173 (diff)
Merge pull request #15048 from kpayson64/use_c_core_for_interop
Use c core for interop
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r--src/core/lib/iomgr/tcp_uv.cc3
-rw-r--r--src/core/lib/iomgr/timer_uv.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/tcp_uv.cc b/src/core/lib/iomgr/tcp_uv.cc
index f20f8dcb74..8d0e4a5e79 100644
--- a/src/core/lib/iomgr/tcp_uv.cc
+++ b/src/core/lib/iomgr/tcp_uv.cc
@@ -204,6 +204,9 @@ static grpc_error* uv_socket_init_helper(uv_socket_t* uv_socket, int domain) {
uv_socket->write_buffers = nullptr;
uv_socket->read_len = 0;
uv_tcp_nodelay(uv_socket->handle, 1);
+ // Node uses a garbage collector to call destructors, so we don't
+ // want to hold the uv loop open with active gRPC objects.
+ uv_unref((uv_handle_t*)uv_socket->handle);
uv_socket->pending_connection = false;
uv_socket->accept_socket = nullptr;
uv_socket->accept_error = GRPC_ERROR_NONE;
diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc
index dadeb960b2..8b7c82eb7d 100644
--- a/src/core/lib/iomgr/timer_uv.cc
+++ b/src/core/lib/iomgr/timer_uv.cc
@@ -52,6 +52,9 @@ static void timer_start(grpc_custom_timer* t) {
uv_timer->data = t;
t->timer = (void*)uv_timer;
uv_timer_start(uv_timer, run_expired_timer, t->timeout_ms, 0);
+ // Node uses a garbage collector to call destructors, so we don't
+ // want to hold the uv loop open with active gRPC objects.
+ uv_unref((uv_handle_t*)uv_timer);
}
static void timer_stop(grpc_custom_timer* t) {