summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtz.pm>2021-11-16 09:20:21 +0100
committerHubert Hirtz <hubert@hirtz.pm>2021-11-16 22:22:10 +0100
commitd40d8dc36a608a1349f8353c50c2c71649e6fa75 (patch)
treed43e01ac710680c5e765e4726ff8928ec2431499 /ui
parentDon't merge message bounds from multiple networks (diff)
Allow App.Close() and App.Run() to be run concurrently
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/ui.go b/ui/ui.go
index cda5a06..ec1fd09 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -60,8 +60,14 @@ func New(config Config) (ui *UI, err error) {
ui.Events = make(chan tcell.Event, 128)
go func() {
for !ui.ShouldExit() {
- ui.Events <- ui.screen.PollEvent()
+ ev := ui.screen.PollEvent()
+ if ev == nil {
+ ui.Exit()
+ break
+ }
+ ui.Events <- ev
}
+ close(ui.Events)
}()
ui.bs = NewBufferList()