Drop Box<dyn PlatformWindow> when the OS closes the native window (#8016)

Closes #7973 

This fixes a leak in GPUI when the user didn't override
`on_should_close_window`.

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
This commit is contained in:
Antonio Scandurra
2024-02-19 15:38:50 +01:00
committed by GitHub
co-authored by Thorsten
parent c33efe8cd0
commit ca251babcd
3 changed files with 25 additions and 25 deletions
+1 -3
View File
@@ -272,9 +272,7 @@ impl PlatformWindow for TestWindow {
self.0.lock().should_close_handler = Some(callback);
}
fn on_close(&self, _callback: Box<dyn FnOnce()>) {
unimplemented!()
}
fn on_close(&self, _callback: Box<dyn FnOnce()>) {}
fn on_appearance_changed(&self, _callback: Box<dyn FnMut()>) {}