ipn/ipnlocal: remove web client listeners after close
This prevents a panic in some cases where WebClientShutdown is called multiple times. Updates tailscale/corp#14335 Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@ -79,8 +79,9 @@ func (b *LocalBackend) WebClientShutdown() {
|
|||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
server := b.webClient.server
|
server := b.webClient.server
|
||||||
b.webClient.server = nil
|
b.webClient.server = nil
|
||||||
for _, ln := range b.webClientListeners {
|
for ap, ln := range b.webClientListeners {
|
||||||
ln.Close()
|
ln.Close()
|
||||||
|
delete(b.webClientListeners, ap)
|
||||||
}
|
}
|
||||||
b.mu.Unlock() // release lock before shutdown
|
b.mu.Unlock() // release lock before shutdown
|
||||||
if server != nil {
|
if server != nil {
|
||||||
|
Reference in New Issue
Block a user