Fix seg fault when using the WindowContext::on_window_should_close() API

This commit is contained in:
Mikayla 2024-01-10 11:23:18 -08:00
parent 2a09c6aad5
commit 7ef88397c9
No known key found for this signature in database
5 changed files with 13 additions and 6 deletions

View file

@ -148,6 +148,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
cx.on_window_should_close(move |cx| {
handle
.update(cx, |workspace, cx| {
// We'll handle closing asynchoronously
workspace.close_window(&Default::default(), cx);
false
})