Skip to content

Commit c1ec72a

Browse files
Fix handle leak: always close thread handle in remove(), not only when queue removal succeeds
Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/2348f69b-81c0-4cf0-9c52-9079bf4b243c Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>
1 parent 177a519 commit c1ec72a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/src/monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl Monitor {
529529
let queue = unsafe { &mut *instance.notify_queue.get() };
530530
let removed = queue.remove(node);
531531
#[cfg(windows)]
532-
if removed && node.thread_handle != 0 {
532+
if node.thread_handle != 0 {
533533
unsafe {
534534
let _ = CloseHandle(node.thread_handle as HANDLE);
535535
}

0 commit comments

Comments
 (0)