diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 65b5507efe6fd6..7c10f4a5588cad 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -73,7 +73,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();