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>
This commit is contained in:
Anna Henningsen authored and Myles Borins committed 2019-11-21 00:29:27 -05:00
1 parent 666588143e
commit 940a2972b2
1 file changed
+1 -5
+1 -5
View File
@@ -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_;