From 9efbb050d91fa056a81f717dae5198b8f295a31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=2E=20R=C3=B8dseth?= Date: Thu, 19 Dec 2024 15:00:41 +0100 Subject: [PATCH] Fix an issue with sometimes not clearing locks when quitting --- v2/keyloop.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/keyloop.go b/v2/keyloop.go index 35173eb2..37fb5f73 100644 --- a/v2/keyloop.go +++ b/v2/keyloop.go @@ -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()) } @@ -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()) } @@ -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 {