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 and Wumpf committed Nov 23, 2024
1 parent f286882 commit 5ea7288
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
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 5ea7288

Please sign in to comment.