summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-26 17:00:53 +0100
committerAnna Henningsen <anna@addaleax.net>2019-11-28 17:49:10 +0100
commitf73716d35aa14d4808be2775dc8374db7aa2fed9 (patch)
treebd21c2b0fb92a3b6b25a20327c10fda473082aee /src
parent8792c3feb8e4852e44924fb059955a150ed863e6 (diff)
downloadandroid-node-v8-f73716d35aa14d4808be2775dc8374db7aa2fed9.tar.gz
android-node-v8-f73716d35aa14d4808be2775dc8374db7aa2fed9.tar.bz2
android-node-v8-f73716d35aa14d4808be2775dc8374db7aa2fed9.zip
src: keep object alive in stream_pipe code
This was overlooked in a489583eda4d7cebc06516834b31dc2a4cedb1b6. Refs: https://github.com/nodejs/node/pull/30374 PR-URL: https://github.com/nodejs/node/pull/30666 Fixes: https://github.com/nodejs/node/issues/30643 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/stream_pipe.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc
index 6e339378ce..b84c8f4c66 100644
--- a/src/stream_pipe.cc
+++ b/src/stream_pipe.cc
@@ -72,7 +72,7 @@ void StreamPipe::Unpipe() {
// 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) {
+ env()->SetImmediate([this, strong_ref](Environment* env) {
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
Local<Object> object = this->object();