Skip to content

Commit

Permalink
Fix leaks of WeakVec (#6576)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 authored Nov 21, 2024
1 parent 00a6032 commit 5ca92bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wgpu-core/src/weak_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<T> WeakVec<T> {
}
if let Some(i) = self.empty_slots.pop() {
self.inner[i] = Some(value);
self.scan_slots_on_next_push = false;
self.scan_slots_on_next_push = self.empty_slots.is_empty();
} else {
self.inner.push(Some(value));
self.scan_slots_on_next_push = self.inner.len() == self.inner.capacity();
Expand Down

0 comments on commit 5ca92bf

Please sign in to comment.