Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
src: remove HandleWrap instances from list once closed
This allows keeping `BaseObjectPtr`s to `HandleWrap` instances.
Previously, the pointer kept the `HandleWrap` object alive, leaving
the Environment cleanup code that waits for the handle list to drain
in a busy loop, because only the `HandleWrap` destructor removed
the item from the list.

Refs: nodejs/quic#165
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
  • Loading branch information
addaleax committed Nov 12, 2019
commit 360b843d040c568a03264aa5548a1627731fca93
1 change: 1 addition & 0 deletions src/handle_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
wrap->state_ = kClosed;

wrap->OnClose();
wrap->handle_wrap_queue_.Remove();

if (!wrap->persistent().IsEmpty() &&
wrap->object()->Has(env->context(), env->handle_onclose_symbol())
Expand Down