Skip to content

Commit

Permalink
remove the manual ref counting and unref the async to allow the proce…
Browse files Browse the repository at this point in the history
…ss to exit
  • Loading branch information
mmomtchev committed Jan 3, 2024
1 parent 36e66a8 commit 45bd917
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/binding/avcpp-readable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void ReadableCustomIO::PushPendingData(uv_async_t *async) {
}
if (self->flowing) {
verbose("ReadableCustomIO: EOF, stop flowing\n");
uv_unref(reinterpret_cast<uv_handle_t *>(self->push_callback));
self->flowing = false;
self->Unref();
}
return;
}
Expand All @@ -141,8 +141,8 @@ void ReadableCustomIO::PushPendingData(uv_async_t *async) {
} while (!self->queue.empty() && more.ToBoolean().Value());
if (more.ToBoolean().Value() == false) {
verbose("ReadableCustomIO: pipe is full, stop flowing\n");
uv_unref(reinterpret_cast<uv_handle_t *>(self->push_callback));
self->flowing = false;
self->Unref();
}
lk.unlock();
// Unblock write if it is waiting because it has reached the high water mark
Expand All @@ -165,8 +165,8 @@ void ReadableCustomIO::_Read(const Napi::CallbackInfo &info) {
}

verbose("ReadableCustomIO: start flowing\n");
uv_ref(reinterpret_cast<uv_handle_t *>(push_callback));
flowing = true;
Ref();
uv_async_send(push_callback);
}

Expand Down

0 comments on commit 45bd917

Please sign in to comment.