mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 15:56:51 +00:00
fix refcell borrow crash
This commit is contained in:
parent
58dbfc6d75
commit
165a24ef83
@ -2933,7 +2933,12 @@ fn on_window_destroyed<T: UserEvent>(window_id: WindowId, context: &Context<T>)
|
||||
let event = WindowEvent::Destroyed;
|
||||
send_window_event(window_id, &context.windows, &context.callback, event);
|
||||
|
||||
let removed = context.windows.borrow_mut().remove(&window_id).is_some();
|
||||
let window = {
|
||||
let mut guard = context.windows.borrow_mut();
|
||||
guard.remove(&window_id)
|
||||
};
|
||||
let removed = window.is_some();
|
||||
drop(window);
|
||||
if !removed {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user