Skip to content

Commit 5f95e69

Browse files
addaleaxMylesBorins
authored andcommitted
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> Backport-PR-URL: #32301 PR-URL: #30374 Refs: nodejs/quic#141 Refs: nodejs/quic#149 Refs: nodejs/quic#141 Reviewed-By: David Carlier <devnexen@gmail.com>
1 parent e17d314 commit 5f95e69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/handle_wrap.cc

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
127127
wrap->state_ = kClosed;
128128

129129
wrap->OnClose();
130+
wrap->handle_wrap_queue_.Remove();
130131

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

0 commit comments

Comments
 (0)