Fix weird macOS crash that occurs when closing the settings window (#2707)
* Fix weird macOS crash that occurs when closing the settings window * Added comment
This commit is contained in:
parent
574c4e98a7
commit
d685762ac7
|
@ -74,7 +74,10 @@ export class SettingsWindow {
|
|||
this.win.on('closed', () => {
|
||||
delete this.win;
|
||||
|
||||
ViewManager.focusCurrentView();
|
||||
// For some reason, on macOS, the app will hard crash when the settings window is closed
|
||||
// It seems to be related to calling view.focus() and there's no log output unfortunately
|
||||
// Adding this arbitrary delay seems to get rid of it (it happens very frequently)
|
||||
setTimeout(() => MainWindow.get()?.focus(), 10);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue