Commit 22c1e6f
fix: make attachListeners idempotent to dedupe registrations
Addresses Codex P2 review on #210: `initialize()` walks
Window.getWindows() to cover already-open windows, and the WINDOW_OPENED
AWTEventListener also lands the same listener when those windows
subsequently fire WINDOW_OPENED. Without dedupe each
graphicsConfiguration change runs the relayout path multiple times, and
uninitialize()'s single removeListener call leaves stale registrations
behind across repeated setLookAndFeel cycles.
Fix: in attachListeners, call removePropertyChangeListener /
removeComponentListener before the add. Both are no-ops if the listener
was not previously registered, so it is safe on the first call too.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 77c92e1 commit 22c1e6f
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
929 | 941 | | |
930 | 942 | | |
931 | 943 | | |
| |||
0 commit comments