mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
Fix crash when closing a window while in full-screen mode
This commit delays closing the native window to the next tick to avoid borrowing either `WindowState` or `MutableAppContext` twice.
This commit is contained in:
parent
d3904cd961
commit
06f9516d31
@ -458,9 +458,15 @@ impl Window {
|
||||
|
||||
impl Drop for Window {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
self.0.as_ref().borrow().native_window.close();
|
||||
}
|
||||
let this = self.0.borrow();
|
||||
let window = this.native_window;
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
window.close();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user