From 52747acfdb835becc65610039daf803c89ff209e Mon Sep 17 00:00:00 2001 From: David Kleingeld Date: Tue, 28 Oct 2025 11:05:10 +0100 Subject: [PATCH] directx: Removes an unwrap that sometimes cause a crash Seen a few crashes on Sentry where the unwrap call fails. No idea why the render_target_view is None. Though since we are dropping anyway we do not need to call unwrap so I removed that. --- crates/gpui/src/platform/windows/directx_renderer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/windows/directx_renderer.rs b/crates/gpui/src/platform/windows/directx_renderer.rs index 220876b4a98693f514886c14ca4b58725f2583d2..eeb25557a853a8def87fec9b0d553192359030a2 100644 --- a/crates/gpui/src/platform/windows/directx_renderer.rs +++ b/crates/gpui/src/platform/windows/directx_renderer.rs @@ -327,7 +327,7 @@ impl DirectXRenderer { // Clear the render target before resizing unsafe { self.devices.device_context.OMSetRenderTargets(None, None) }; unsafe { ManuallyDrop::drop(&mut self.resources.render_target) }; - drop(self.resources.render_target_view[0].take().unwrap()); + drop(self.resources.render_target_view[0].take()); // Resizing the swap chain requires a call to the underlying DXGI adapter, which can return the device removed error. // The app might have moved to a monitor that's attached to a different graphics device.