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

PR-URL: #30666
Fixes: #30643
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax committed Nov 30, 2019
1 parent 9d8d2e1 commit d54432f
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 @@ -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();
Expand Down

0 comments on commit d54432f

Please sign in to comment.