mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
666588143e
commit
940a2972b2
1 file changed
+1
-5
+1
-5
@@ -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_;
|
||||
|
||||
Reference in new issue
Block a user