Skip to content

Commit 6db84d3

Browse files
addaleaxMylesBorins
authored andcommitted
src: use BaseObjectPtr for keeping channel alive in dns bindings
Backport-PR-URL: #32301 PR-URL: #30374 Refs: nodejs/quic#141 Refs: nodejs/quic#149 Refs: nodejs/quic#141 Refs: nodejs/quic#165 Reviewed-By: James M Snell <[email protected]> Reviewed-By: David Carlier <[email protected]>
1 parent 4745ac4 commit 6db84d3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/cares_wrap.cc

+1-5
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,6 @@ class QueryWrap : public AsyncWrap {
575575
: AsyncWrap(channel->env(), req_wrap_obj, AsyncWrap::PROVIDER_QUERYWRAP),
576576
channel_(channel),
577577
trace_name_(name) {
578-
// Make sure the channel object stays alive during the query lifetime.
579-
req_wrap_obj->Set(env()->context(),
580-
env()->channel_string(),
581-
channel->object()).Check();
582578
}
583579

584580
~QueryWrap() override {
@@ -735,7 +731,7 @@ class QueryWrap : public AsyncWrap {
735731
UNREACHABLE();
736732
}
737733

738-
ChannelWrap* channel_;
734+
BaseObjectPtr<ChannelWrap> channel_;
739735

740736
private:
741737
std::unique_ptr<ResponseData> response_data_;

0 commit comments

Comments
 (0)