Repository navigation
Commit a103cf6
committed
fix(desktop): input during window teardown no longer throws in the main process
A trailing key-up (e.g. releasing a held Cmd+Q) can reach the window's
before-input-event and input-event listeners after the BrowserWindow is
destroyed. Both read window.webContents unguarded, so Electron threw
"TypeError: Object has been destroyed" as an uncaught main-process error.
Both listeners now return early once the window is destroyed, like the
zoom-changed listener. The quit shortcut handler still runs first in
before-input-event, since it guards its own window access and must see
the key-up.
Fixes #33614
AI-assisted; verified with the tests and tools listed above.1 parent d1c29f0 commit a103cf6
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| 680 | + | |
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
| |||
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
0 commit comments