Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 107b141

Browse files
committed
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. PR-URL: #165 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent 1ff05f4 commit 107b141

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/handle_wrap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
131131
wrap->state_ = kClosed;
132132

133133
wrap->OnClose();
134+
wrap->handle_wrap_queue_.Remove();
134135

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

0 commit comments

Comments
 (0)