Skip to content

Commit b3490de

Browse files
authored
[d3d12] Avoid panic on instance drop (#5134)
1 parent 6440af0 commit b3490de

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Bottom level categories:
7171

7272
### Bug Fixes
7373

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

7679
- 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).

wgpu-hal/src/dx12/instance.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use std::{mem, sync::Arc};
77

88
impl Drop for super::Instance {
99
fn drop(&mut self) {
10-
crate::auxil::dxgi::exception::unregister_exception_handler();
10+
if self.flags.contains(wgt::InstanceFlags::VALIDATION) {
11+
crate::auxil::dxgi::exception::unregister_exception_handler();
12+
}
1113
}
1214
}
1315

0 commit comments

Comments
 (0)