From b193352d1ed4df2580adf4a24e343b6a3087ef49 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 27 Jun 2022 14:23:44 +0300 Subject: [PATCH] [#1548] morph/client: Execute close callback without switch mutex Signed-off-by: Evgenii Stratonikov --- pkg/morph/client/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index dd5ad73fc..4119c7dd7 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -579,10 +579,9 @@ func (c *Client) NotificationChannel() <-chan client.Notification { // - inactiveModeCb is called if not nil. func (c *Client) inactiveMode() { c.switchLock.Lock() - defer c.switchLock.Unlock() - close(c.notifications) c.inactive = true + c.switchLock.Unlock() if c.cfg.inactiveModeCb != nil { c.cfg.inactiveModeCb()