Commit 5d92ea8
committed
fix: store StreamSubscription refs so SIGINT/SIGTERM are not GC'd in server mode
Fix: In _waitForSignal(), ProcessSignal.sigint.watch().listen() and
sigterm.watch().listen() returned StreamSubscriptions that were not
stored. Dart GC collects unowned StreamSubscriptions, which
automatically cancels them, causing Ctrl+C to silently stop working
after an unpredictable interval.
Store both subscriptions and cancel them explicitly after the
completer fires so signal delivery is reliable for the entire
lifetime of the headless server.1 parent b0b0a3a commit 5d92ea8
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
0 commit comments