diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-26 17:08:11 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-28 17:49:17 +0100 |
commit | 4c9db6c74150d3f5487798ca654496fdaf343422 (patch) | |
tree | 668281657a07142125eb395cbb147bba43fd21ad /src/stream_pipe.h | |
parent | 5b59c248413af4e81a0616286790b3dc718107ef (diff) | |
download | android-node-v8-4c9db6c74150d3f5487798ca654496fdaf343422.tar.gz android-node-v8-4c9db6c74150d3f5487798ca654496fdaf343422.tar.bz2 android-node-v8-4c9db6c74150d3f5487798ca654496fdaf343422.zip |
src: no SetImmediate from destructor in stream_pipe code
Guard against running `SetImmediate()` from the destructor.
The object will not be alive or usable in the callback,
so it does not make sense to attempt to schedule the
`SetImmediate()`.
PR-URL: https://github.com/nodejs/node/pull/30666
Fixes: https://github.com/nodejs/node/issues/30643
Refs: https://github.com/nodejs/node/pull/30374
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/stream_pipe.h')
-rw-r--r-- | src/stream_pipe.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_pipe.h b/src/stream_pipe.h index 061ad9842e..0e15500610 100644 --- a/src/stream_pipe.h +++ b/src/stream_pipe.h @@ -12,7 +12,7 @@ class StreamPipe : public AsyncWrap { StreamPipe(StreamBase* source, StreamBase* sink, v8::Local<v8::Object> obj); ~StreamPipe() override; - void Unpipe(); + void Unpipe(bool is_in_deletion = false); static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void Start(const v8::FunctionCallbackInfo<v8::Value>& args); |