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,7 +44,9 @@ func StartServer() {
|
|||||||
|
|
||||||
func StopServer() {
|
func StopServer() {
|
||||||
server.wg.Wait()
|
server.wg.Wait()
|
||||||
server.ln.Close()
|
if server.ln != nil {
|
||||||
|
server.ln.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handler(conn net.Conn) {
|
func handler(conn net.Conn) {
|
||||||
|
10
menus.go
10
menus.go
@ -15,8 +15,8 @@ var helpDialog = []menu.Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func HelpMenu() {
|
func HelpMenu() {
|
||||||
ResetView()
|
ui.DefaultEvtStream.ResetHandlers()
|
||||||
defer ResetView()
|
defer ui.DefaultEvtStream.ResetHandlers()
|
||||||
|
|
||||||
m := menu.NewMenu()
|
m := menu.NewMenu()
|
||||||
m.TextFgColor = ui.ColorWhite
|
m.TextFgColor = ui.ColorWhite
|
||||||
@ -32,7 +32,7 @@ func HelpMenu() {
|
|||||||
|
|
||||||
func FilterMenu() {
|
func FilterMenu() {
|
||||||
ui.DefaultEvtStream.ResetHandlers()
|
ui.DefaultEvtStream.ResetHandlers()
|
||||||
defer ResetView()
|
defer ui.DefaultEvtStream.ResetHandlers()
|
||||||
|
|
||||||
i := widgets.NewInput()
|
i := widgets.NewInput()
|
||||||
i.TextFgColor = ui.ColorWhite
|
i.TextFgColor = ui.ColorWhite
|
||||||
@ -49,8 +49,8 @@ func FilterMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SortMenu() {
|
func SortMenu() {
|
||||||
ResetView()
|
ui.DefaultEvtStream.ResetHandlers()
|
||||||
defer ResetView()
|
defer ui.DefaultEvtStream.ResetHandlers()
|
||||||
|
|
||||||
m := menu.NewMenu()
|
m := menu.NewMenu()
|
||||||
m.Selectable = true
|
m.Selectable = true
|
||||||
|
Loading…
Reference in New Issue
Block a user