Skip to content

Commit

Permalink
gpsd: don't unregister nil subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdrichard committed Jun 20, 2024
1 parent 406b8fa commit 15e7713
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/daemon/daemon/gpsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func (g *GPSD) CmdStop() {
glog.Infof("Process %s (%d) failed to terminate", g.name, g.cmd.Process.Pid)
}
}
g.unRegisterSubscriber()
if g.subscriber != nil {
g.unRegisterSubscriber()
}
<-g.exitCh // waiting for all child routines to exit; we could add timeout to avoid waiting
g.monitorCancel()
glog.Infof("Process %s terminated", g.name)
Expand Down

0 comments on commit 15e7713

Please sign in to comment.