From 52ae707c32dda2240a58352775b022eea581432c Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Fri, 26 Jul 2024 09:40:23 +0200 Subject: [PATCH] Fix AnyDevice drop implementation dropping the wrong thing --- 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 c63d7c35c9b..2bdc6698ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ Bottom level categories: - Print requested and supported usages on `UnsupportedUsage` error. By @VladasZ in [#6007](https://github.com/gfx-rs/wgpu/pull/6007) - Fix function for checking bind compatibility to error instead of panic. By @sagudev [#6012](https://github.com/gfx-rs/wgpu/pull/6012) - Deduplicate bind group layouts that are created from pipelines with "auto" layouts. By @teoxoy [#6049](https://github.com/gfx-rs/wgpu/pull/6049) +- Fix crash when dropping the surface after the device. By @wumpf in [#????](https://github.com/gfx-rs/wgpu/pull/????) ### Dependency Updates diff --git a/wgpu-core/src/device/any_device.rs b/wgpu-core/src/device/any_device.rs index 9e459c1a944..e796bf0574c 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::>()); } }