Commit 2f20cca
Only remove a Window's own entry from the static registry on Dispose
TryRemove(name, out _) deleted whatever instance currently occupied
that key, regardless of identity. If a second Window reused a name
before the first was disposed (Windows[name] = this in the
constructor lets that happen intentionally), disposing the first one
would evict the second, still-live window from the registry even
though it's unaffected. Use the ICollection<KeyValuePair<,>> overload
of Remove, which only deletes the entry when both the key and the
value (reference identity) match.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 28831ba commit 2f20cca
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
0 commit comments