Fix leaks of WeakVec (#6576)

This commit is contained in:
Xiaopeng Li authored and Andreas Reich committed 2024-11-24 00:01:22 +01:00
1 parent f286882924
commit 5ea7288988
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -44,6 +44,11 @@ Bottom level categories:
### Bug fixes
#### General
- Fix Texture view leaks regression. By @xiaopengli89 in [#6576](https://github.com/gfx-rs/wgpu/pull/6576)
#### Metal
- Fix surface creation crashing on iOS. By @mockersf in [#6535](https://github.com/gfx-rs/wgpu/pull/6535)
+1 -1
View File
@@ -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();