mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
Fix crash on command buffer drop (#3726)
This commit is contained in:
parent
66c029f172
commit
1dd105c3bf
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user