Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui_wgpu: Release surface resources during destroy (#51561)

AxXxB22f3d06c0e02
diff --git a/crates/gpui_wgpu/src/wgpu_renderer.rs b/crates/gpui_wgpu/src/wgpu_renderer.rs
index 2197f6914e4..af9668780a1 100644
--- a/crates/gpui_wgpu/src/wgpu_renderer.rs
+++ b/crates/gpui_wgpu/src/wgpu_renderer.rs
@@ -1620,7 +1620,9 @@ impl WgpuRenderer {
}
pub fn destroy(&mut self) {
- // wgpu resources are automatically cleaned up when dropped
+ // Release surface-bound GPU resources eagerly so the underlying native
+ // window can be destroyed before the renderer itself is dropped.
+ self.resources.take();
}
/// Returns true if the GPU device was lost and recovery is needed.