Skip to content

Commit

Permalink
Fix crash on command buffer drop
Browse files Browse the repository at this point in the history
Wrong object was passed for `data` to `command_buffer_drop`
  • Loading branch information
Wumpf committed Apr 24, 2023
1 parent 3432aab commit 539ad50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down

0 comments on commit 539ad50

Please sign in to comment.