Skip to content

Commit 65c66a1

Browse files
committed
std: fix registering of Windows TLS destructors
1 parent b18990b commit 65c66a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/std/src/sys/windows/thread_local_key.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ unsafe fn run_keyless_dtors() {
4242
// the case that this loop always terminates because we provide the
4343
// guarantee that a TLS key cannot be set after it is flagged for
4444
// destruction.
45-
while let Some((ptr, dtor)) = DESTRUCTORS.borrow_mut().pop() {
45+
loop {
46+
let Some((ptr, dtor)) = DESTRUCTORS.borrow_mut().pop() else {
47+
break;
48+
};
4649
(dtor)(ptr);
4750
}
4851
// We're done so free the memory.

0 commit comments

Comments
 (0)