diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 6e339378ceb374..b84c8f4c663422 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 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 = this->object();