Skip to content

Commit

Permalink
Make sure that file-local marks are cleared when clear is invoked
Browse files Browse the repository at this point in the history
Clear will simply close the current pcap - without loading a new
one. But we still have to clear file local marks, even without a new
pcap loaded.
  • Loading branch information
gcla committed Aug 1, 2020
1 parent 96f7d7c commit 440a5ec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ func reallyClear(app gowid.IApp) {
MakeUpdateCurrentCaptureInTitle(app),
ManageStreamCache{},
ManageCapinfoCache{},
MakeCheckForJump(app),
},
)
},
Expand Down Expand Up @@ -2336,11 +2337,20 @@ func MakeCheckForJump(app gowid.IApp) checkForJump {
}
}

func (t checkForJump) OnNewSource(closeMe chan<- struct{}) {
func clearMarks() {
for k := range marksMap {
delete(marksMap, k)
}
lastJumpPos = -1
}

func (t checkForJump) OnNewSource(closeMe chan<- struct{}) {
clearMarks()
close(closeMe)
}

func (t checkForJump) OnClear(closeMe chan<- struct{}) {
clearMarks()
close(closeMe)
}

Expand Down

0 comments on commit 440a5ec

Please # to comment.