commit 511a95b

Hubert Hirtz  ·  2021-01-07 11:17:31 +0000 UTC
parent be78c42
Fix random crash on startup

The .exit value would be read before it was initialized.
1 files changed,  +2, -2
+2, -2
 1@@ -46,6 +46,8 @@ func New(config Config) (ui *UI, err error) {
 2 	ui.screen.Clear()
 3 	ui.screen.ShowCursor(0, h-2)
 4 
 5+	ui.exit.Store(false)
 6+
 7 	ui.Events = make(chan tcell.Event, 128)
 8 	go func() {
 9 		for !ui.ShouldExit() {
10@@ -53,8 +55,6 @@ func New(config Config) (ui *UI, err error) {
11 		}
12 	}()
13 
14-	ui.exit.Store(false)
15-
16 	ui.bs = NewBufferList(w, h, ui.config.NickColWidth)
17 	ui.e = NewEditor(w, ui.config.AutoComplete)
18 	ui.Resize()