From 6db84d3e501b3fe60717941ff9350d83e556e5af Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 12 Nov 2019 13:47:08 +0000 Subject: [PATCH] src: use BaseObjectPtr for keeping channel alive in dns bindings Backport-PR-URL: https://github.com/nodejs/node/pull/32301 PR-URL: https://github.com/nodejs/node/pull/30374 Refs: https://github.com/nodejs/quic/pull/141 Refs: https://github.com/nodejs/quic/pull/149 Refs: https://github.com/nodejs/quic/pull/141 Refs: https://github.com/nodejs/quic/pull/165 Reviewed-By: James M Snell Reviewed-By: David Carlier --- src/cares_wrap.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 98ae98270b450d..ea29b2d79053fe 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -575,10 +575,6 @@ class QueryWrap : public AsyncWrap { : AsyncWrap(channel->env(), req_wrap_obj, AsyncWrap::PROVIDER_QUERYWRAP), channel_(channel), trace_name_(name) { - // Make sure the channel object stays alive during the query lifetime. - req_wrap_obj->Set(env()->context(), - env()->channel_string(), - channel->object()).Check(); } ~QueryWrap() override { @@ -735,7 +731,7 @@ class QueryWrap : public AsyncWrap { UNREACHABLE(); } - ChannelWrap* channel_; + BaseObjectPtr channel_; private: std::unique_ptr response_data_;