Merge pull request #1534 from zed-industries/fix-crash-on-window-close

Fix crash when closing a window while in full-screen mode
This commit is contained in:
Antonio Scandurra 2022-08-18 15:58:49 +02:00 committed by GitHub
commit 6ffaa0394a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -458,9 +458,15 @@ impl Window {
impl Drop for Window {
fn drop(&mut self) {
let this = self.0.borrow();
let window = this.native_window;
this.executor
.spawn(async move {
unsafe {
self.0.as_ref().borrow().native_window.close();
window.close();
}
})
.detach();
}
}