Skip to content

Commit

Permalink
Fix an issue with sometimes not clearing locks when quitting
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Dec 19, 2024
1 parent bce270b commit 9efbb05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2/keyloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
if absFilename, err := filepath.Abs(e.filename); err == nil { // success
e.SetUpSignalHandlers(c, tty, status, true) // only clear signals
var wg sync.WaitGroup
go e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &wg)
e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &wg)
wg.Wait()
quitToMan(tty, pwd, absFilename, c.W(), c.H())
}
Expand All @@ -428,7 +428,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
if pwd, err := os.Getwd(); err == nil {
e.SetUpSignalHandlers(c, tty, status, true) // only clear signals
var wg sync.WaitGroup
go e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &wg)
e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &wg)
wg.Wait()
quitToNroff(tty, pwd, c.W(), c.H())
}
Expand Down Expand Up @@ -2253,7 +2253,7 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
} // end of main loop

var closeLocksWaitGroup sync.WaitGroup
go e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &closeLocksWaitGroup)
e.CloseLocksAndLocationHistory(canUseLocks, absFilename, lockTimestamp, forceFlag, &closeLocksWaitGroup)

// Quit everything that has to do with the terminal
if e.clearOnQuit {
Expand Down

0 comments on commit 9efbb05

Please sign in to comment.