From 4ee1abdafff0452bdee5e6a586782211c9f11270 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 5 Apr 2017 14:26:20 +0200 Subject: [PATCH] refactor --- app/proxyman/mux/mux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/proxyman/mux/mux.go b/app/proxyman/mux/mux.go index 687fe790..3ae9c629 100644 --- a/app/proxyman/mux/mux.go +++ b/app/proxyman/mux/mux.go @@ -158,6 +158,8 @@ func (m *Client) Closed() bool { } func (m *Client) monitor() { + defer m.manager.onClientFinish() + for { select { case <-m.ctx.Done(): @@ -172,8 +174,6 @@ func (m *Client) monitor() { } func (m *Client) cleanup() { - defer m.manager.onClientFinish() - m.access.Lock() defer m.access.Unlock()