From 735ecd035ebe5df655048c3e94af7c85b8096e9f Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Fri, 26 Jul 2024 10:31:36 +0200 Subject: [PATCH] Fix AnyDevice drop implementation dropping the wrong thing (#6052) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 1 + wgpu-core/src/device/any_device.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7007f6d..55b0e6ab6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Bottom level categories: #### General - Fix function for checking bind compatibility to error instead of panic. By @sagudev [#6012](https://github.com/gfx-rs/wgpu/pull/6012) +- Fix crash when dropping the surface after the device. By @wumpf in [#6052](https://github.com/gfx-rs/wgpu/pull/6052) ## 22.0.0 (2024-07-17) diff --git a/wgpu-core/src/device/any_device.rs b/wgpu-core/src/device/any_device.rs index 9e459c1a9..e796bf057 100644 --- a/wgpu-core/src/device/any_device.rs +++ b/wgpu-core/src/device/any_device.rs @@ -34,7 +34,7 @@ impl AnyDevice { unsafe fn drop_glue(ptr: *mut ()) { // Drop the arc this instance is holding. unsafe { - _ = Arc::from_raw(ptr.cast::()); + _ = Arc::from_raw(ptr.cast::>()); } }