diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-12 16:47:08 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-19 15:47:31 +0300 |
commit | c0b5e6fd4b87d1e61151b77b3ec10e6650f5153b (patch) | |
tree | 31607b0409b8c76ece07bfcebb987b24c266869e | |
parent | a36f2204d6ffd80437f2b713787c18a58e328e05 (diff) |
src: use BaseObjectPtr for keeping channel alive in dns bindings
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 <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
-rw-r--r-- | src/cares_wrap.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 96062cb4819..ee521ce64a0 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<ChannelWrap> channel_; private: std::unique_ptr<ResponseData> response_data_; |