Check if global discovery was actually started before trying to stop it (fixes #653)

This commit is contained in:
Audrius Butkevicius 2014-09-09 23:56:44 +01:00
parent 9d0dc45f74
commit 5772588c29

View File

@ -108,9 +108,11 @@ func (d *Discoverer) StartGlobal(server string, extPort uint16) {
} }
func (d *Discoverer) StopGlobal() { func (d *Discoverer) StopGlobal() {
if d.stopGlobal != nil {
close(d.stopGlobal) close(d.stopGlobal)
d.globalWG.Wait() d.globalWG.Wait()
} }
}
func (d *Discoverer) ExtAnnounceOK() bool { func (d *Discoverer) ExtAnnounceOK() bool {
d.extAnnounceOKmut.Lock() d.extAnnounceOKmut.Lock()