mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
src: keep object alive in stream_pipe code
This was overlooked in a489583eda.
Refs: https://github.com/nodejs/node/pull/30374
PR-URL: https://github.com/nodejs/node/pull/30666
Fixes: https://github.com/nodejs/node/issues/30643
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user