diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-12 17:01:08 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-19 15:47:33 +0300 |
commit | a489583eda4d7cebc06516834b31dc2a4cedb1b6 (patch) | |
tree | 8ead818f1ed28ce7c8965917209abc8d5b85bcb0 /src/stream_pipe.cc | |
parent | c0b5e6fd4b87d1e61151b77b3ec10e6650f5153b (diff) |
src: remove keep alive option from SetImmediate()
This is no longer necessary now that the copyable `BaseObjectPtr`
is available (as opposed to the only-movable `v8::Global`).
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>
Diffstat (limited to 'src/stream_pipe.cc')
-rw-r--r-- | src/stream_pipe.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 832a20d324f..6e339378ceb 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -71,6 +71,7 @@ void StreamPipe::Unpipe() { // Delay the JS-facing part with SetImmediate, because this might be from // inside the garbage collector, so we can’t run JS here. HandleScope handle_scope(env()->isolate()); + BaseObjectPtr<StreamPipe> strong_ref{this}; env()->SetImmediate([this](Environment* env) { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); @@ -105,7 +106,7 @@ void StreamPipe::Unpipe() { .IsNothing()) { return; } - }, object()); + }); } uv_buf_t StreamPipe::ReadableListener::OnStreamAlloc(size_t suggested_size) { |