client/systray: add missing deferred unlock for httpCache mutex
Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@@ -372,6 +372,7 @@ func setRemoteIcon(menu *systray.MenuItem, urlStr string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cacheMu.Lock()
|
cacheMu.Lock()
|
||||||
|
defer cacheMu.Unlock()
|
||||||
b, ok := httpCache[urlStr]
|
b, ok := httpCache[urlStr]
|
||||||
if !ok {
|
if !ok {
|
||||||
resp, err := http.Get(urlStr)
|
resp, err := http.Get(urlStr)
|
||||||
@@ -395,7 +396,6 @@ func setRemoteIcon(menu *systray.MenuItem, urlStr string) {
|
|||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cacheMu.Unlock()
|
|
||||||
|
|
||||||
if len(b) > 0 {
|
if len(b) > 0 {
|
||||||
menu.SetIcon(b)
|
menu.SetIcon(b)
|
||||||
|
|||||||
Reference in New Issue
Block a user