fix: add missing signal.Stop in suspendProcess to prevent signal channel leak (Closes #1673) (#1674)
Each Ctrl+Z suspend call registered a SIGCONT channel via signal.Notify but never called signal.Stop after receiving the signal. This caused a signal channel leak on every suspend/resume cycle. All other signal handlers in the codebase (handleSignals in tea.go and listenForResize in signals_unix.go) correctly defer signal.Stop. Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>
This commit is contained in:
parent
05df5aecf8
commit
729f05c315
1 changed files with 1 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ const suspendSupported = true
|
|||
func suspendProcess() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGCONT)
|
||||
defer signal.Stop(c)
|
||||
_ = syscall.Kill(0, syscall.SIGTSTP)
|
||||
// blocks until a CONT happens...
|
||||
<-c
|
||||
|
|
|
|||
Loading…
Reference in a new issue