Fix crash on command buffer drop (#3726)

This commit is contained in:
Andreas Reich authored and GitHub committed 2023-05-03 05:00:59 -04:00
1 parent 66c029f172
commit 1dd105c3bf
2 files changed
+10 -2

No files matched your search

+7
View File
@@ -40,6 +40,13 @@ Bottom level categories:
## Unreleased
### Bug Fixes
#### General
- Fix crash on dropping `wgpu::CommandBuffer`. By @wumpf in [#3726](https://github.com/gfx-rs/wgpu/pull/3726).
## v0.16.0 (2023-04-19)
### Major changes
+3 -2
View File
@@ -574,8 +574,9 @@ static_assertions::assert_impl_all!(CommandBuffer: Send, Sync);
impl Drop for CommandBuffer {
fn drop(&mut self) {
if !thread::panicking() {
if let Some(ref id) = self.id {
self.context.command_buffer_drop(id, &self.data.take());
if let Some(id) = self.id.take() {
self.context
.command_buffer_drop(&id, self.data.take().unwrap().as_ref());
}
}
}