Skip to content

Commit

Permalink
Fix dropping Device if not using indirect validation (#6681)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone authored Dec 7, 2024
1 parent ebdd958 commit 11b5169
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
- Check that begin and end indices are not equal.
- Check that at least one index is specified.
- Reject destroyed buffers in query set resolution. By @ErichDonGubler in [#6579](https://github.com/gfx-rs/wgpu/pull/6579).
- Fix panic when dropping `Device` on some environments. By @Dinnerbone in [#6681](https://github.com/gfx-rs/wgpu/pull/6681).

#### Naga

Expand Down
7 changes: 3 additions & 4 deletions wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,9 @@ impl Drop for Device {
// SAFETY: We are in the Drop impl and we don't use self.fence anymore after this point.
let fence = unsafe { ManuallyDrop::take(&mut self.fence.write()) };
#[cfg(feature = "indirect-validation")]
self.indirect_validation
.take()
.unwrap()
.dispose(self.raw.as_ref());
if let Some(indirect_validation) = self.indirect_validation.take() {
indirect_validation.dispose(self.raw.as_ref());
}
unsafe {
self.raw.destroy_buffer(zero_buffer);
self.raw.destroy_fence(fence);
Expand Down

0 comments on commit 11b5169

Please sign in to comment.