Skip to content

Commit

Permalink
src: keep object alive in stream_pipe code
Browse files Browse the repository at this point in the history
This was overlooked in a489583.

Refs: #30374

Backport-PR-URL: #32301
PR-URL: #30666
Fixes: #30643
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and MylesBorins committed Apr 1, 2020
1 parent 5f95e69 commit 7647bfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream_pipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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();
Expand Down

0 comments on commit 7647bfe

Please sign in to comment.