| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 94357db commit bea2501
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ StreamPipe::StreamPipe(StreamBase* source, | |||
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | StreamPipe::~StreamPipe() { | |
| 45 | - Unpipe(); | ||
| 45 | + Unpipe(true); | ||
| 46 | 46 | } | |
| 47 | 47 | ||
| 48 | 48 | StreamBase* StreamPipe::source() { | |
@@ -53,7 +53,7 @@ StreamBase* StreamPipe::sink() { | |||
| 53 | 53 | return static_cast<StreamBase*>(writable_listener_.stream()); | |
| 54 | 54 | } | |
| 55 | 55 | ||
| 56 | - void StreamPipe::Unpipe() { | ||
| 56 | + void StreamPipe::Unpipe(bool is_in_deletion) { | ||
| 57 | 57 | if (is_closed_) | |
| 58 | 58 | return; | |
| 59 | 59 | ||
@@ -68,6 +68,8 @@ void StreamPipe::Unpipe() { | |||
| 68 | 68 | source()->RemoveStreamListener(&readable_listener_); | |
| 69 | 69 | sink()->RemoveStreamListener(&writable_listener_); | |
| 70 | 70 | ||
| 71 | + if (is_in_deletion) return; | ||
| 72 | + | ||
| 71 | 73 | // Delay the JS-facing part with SetImmediate, because this might be from | |
| 72 | 74 | // inside the garbage collector, so we can’t run JS here. | |
| 73 | 75 | HandleScope handle_scope(env()->isolate()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ class StreamPipe : public AsyncWrap { | |||
| 12 | 12 | StreamPipe(StreamBase* source, StreamBase* sink, v8::Local<v8::Object> obj); | |
| 13 | 13 | ~StreamPipe() override; | |
| 14 | 14 | ||
| 15 | - void Unpipe(); | ||
| 15 | + void Unpipe(bool is_in_deletion = false); | ||
| 16 | 16 | ||
| 17 | 17 | static void New(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 18 | 18 | static void Start(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments