Compare commits

...

1 Commits

Author SHA1 Message Date
David Kleingeld
52747acfdb 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.
2025-10-28 11:05:10 +01:00

View File

@@ -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.