Commit f504ef9
Fix comprehensive memory leaks (adapted from PR dwarvesf#335)
Adds the non-overlapping pieces of huynguyenh's PR dwarvesf#335 on top of
rm335's PR dwarvesf#346. Handles the biggest leak source (NSLayoutConstraint
retention when NSImageViews were recreated 9-10 times per toggle).
- Deactivate NSLayoutConstraints before removing views in
NSStackView.removeAllSubViews (prevents constraint retention of
removed NSImageViews — primary leak source on macOS Sequoia/Tahoe)
- Extend StatusBarController.deinit to invalidate timer and remove
the always-hidden NSStatusItem
- Change toggleStatusBarIfNeeded to only create the always-hidden
status item when it doesn't already exist, instead of tearing down
and recreating on every .alwayHideToggle notification
Combined with the widest-display collapse-length calc in dwarvesf#354 and the
bounded-length work in dwarvesf#344, this should resolve the runaway memory
growth reported in upstream dwarvesf#326, dwarvesf#336, dwarvesf#351, dwarvesf#352.
Co-Authored-By: huynguyenh <hoanghuy2908@gmail.com>1 parent 8379f7f commit f504ef9
2 files changed
Lines changed: 16 additions & 11 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
272 | | - | |
| 277 | + | |
273 | 278 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
281 | 286 | | |
282 | | - | |
283 | 287 | | |
284 | | - | |
285 | | - | |
| 288 | + | |
| 289 | + | |
286 | 290 | | |
287 | 291 | | |
288 | 292 | | |
| |||
0 commit comments