Fix: Main loop blocked by double quit (#2674)
This commit is contained in:
1 parent
1c9029e9ec
commit
274b13df9e
2 files changed
+10
-2
No files matched your search
@@ -95,6 +95,14 @@ func (app *app) quit() {
|
||||
}
|
||||
}
|
||||
|
||||
// requestQuit signals the main loop to quit and never blocks when a request is already pending.
|
||||
func (app *app) requestQuit() {
|
||||
select {
|
||||
case app.quitChan <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
func (app *app) readFile(path string) {
|
||||
log.Printf("reading file: %s", path)
|
||||
|
||||
|
||||
Reference in new issue
Block a user