Skip to content

Commit

Permalink
std: fix registering of Windows TLS destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
joboet committed Oct 7, 2023
1 parent b18990b commit 65c66a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/std/src/sys/windows/thread_local_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ unsafe fn run_keyless_dtors() {
// the case that this loop always terminates because we provide the
// guarantee that a TLS key cannot be set after it is flagged for
// destruction.
while let Some((ptr, dtor)) = DESTRUCTORS.borrow_mut().pop() {
loop {
let Some((ptr, dtor)) = DESTRUCTORS.borrow_mut().pop() else {
break;
};
(dtor)(ptr);
}
// We're done so free the memory.
Expand Down

0 comments on commit 65c66a1

Please sign in to comment.