Skip to content

Commit

Permalink
[d3d12] Avoid panic on instance drop (#5134)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao authored Jan 24, 2024
1 parent 6440af0 commit b3490de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ Bottom level categories:

### Bug Fixes

#### General
- Fix `panic!` when dropping `Instance` without `InstanceFlags::VALIDATION`. By @hakolao in [#5134](https://github.com/gfx-rs/wgpu/pull/5134)

#### WGL

- In Surface::configure and Surface::present, fix the current GL context not being unset when releasing the lock that guards access to making the context current. This was causing other threads to panic when trying to make the context current. By @Imberflur in [#5087](https://github.com/gfx-rs/wgpu/pull/5087).
Expand Down
4 changes: 3 additions & 1 deletion wgpu-hal/src/dx12/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use std::{mem, sync::Arc};

impl Drop for super::Instance {
fn drop(&mut self) {
crate::auxil::dxgi::exception::unregister_exception_handler();
if self.flags.contains(wgt::InstanceFlags::VALIDATION) {
crate::auxil::dxgi::exception::unregister_exception_handler();
}
}
}

Expand Down

0 comments on commit b3490de

Please sign in to comment.