Skip to content

Commit b18531d

Browse files
addaleaxMylesBorins
authored andcommitted
src: keep object alive in stream_pipe code
This was overlooked in a489583. Refs: nodejs#30374 PR-URL: nodejs#30666 Fixes: nodejs#30643 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 92cb961 commit b18531d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/stream_pipe.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void StreamPipe::Unpipe() {
7373
// inside the garbage collector, so we can’t run JS here.
7474
HandleScope handle_scope(env()->isolate());
7575
BaseObjectPtr<StreamPipe> strong_ref{this};
76-
env()->SetImmediate([this](Environment* env) {
76+
env()->SetImmediate([this, strong_ref](Environment* env) {
7777
HandleScope handle_scope(env->isolate());
7878
Context::Scope context_scope(env->context());
7979
Local<Object> object = this->object();

0 commit comments

Comments
 (0)