mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
check for nil listener before close
This commit is contained in:
parent
0e8480ce5d
commit
db050031df
@ -44,8 +44,10 @@ func StartServer() {
|
||||
|
||||
func StopServer() {
|
||||
server.wg.Wait()
|
||||
if server.ln != nil {
|
||||
server.ln.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func handler(conn net.Conn) {
|
||||
server.wg.Add(1)
|
||||
|
10
menus.go
10
menus.go
@ -15,8 +15,8 @@ var helpDialog = []menu.Item{
|
||||
}
|
||||
|
||||
func HelpMenu() {
|
||||
ResetView()
|
||||
defer ResetView()
|
||||
ui.DefaultEvtStream.ResetHandlers()
|
||||
defer ui.DefaultEvtStream.ResetHandlers()
|
||||
|
||||
m := menu.NewMenu()
|
||||
m.TextFgColor = ui.ColorWhite
|
||||
@ -32,7 +32,7 @@ func HelpMenu() {
|
||||
|
||||
func FilterMenu() {
|
||||
ui.DefaultEvtStream.ResetHandlers()
|
||||
defer ResetView()
|
||||
defer ui.DefaultEvtStream.ResetHandlers()
|
||||
|
||||
i := widgets.NewInput()
|
||||
i.TextFgColor = ui.ColorWhite
|
||||
@ -49,8 +49,8 @@ func FilterMenu() {
|
||||
}
|
||||
|
||||
func SortMenu() {
|
||||
ResetView()
|
||||
defer ResetView()
|
||||
ui.DefaultEvtStream.ResetHandlers()
|
||||
defer ui.DefaultEvtStream.ResetHandlers()
|
||||
|
||||
m := menu.NewMenu()
|
||||
m.Selectable = true
|
||||
|
Loading…
Reference in New Issue
Block a user