From a538de56dea6465bc0bba491fa6d7c28f1ad4ee4 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 1 May 2016 17:19:41 +0200 Subject: [PATCH] detect end of channel --- common/log/log_writer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/log/log_writer.go b/common/log/log_writer.go index ab955594a..a783a86df 100644 --- a/common/log/log_writer.go +++ b/common/log/log_writer.go @@ -55,7 +55,10 @@ func (this *fileLogWriter) Log(log LogEntry) { func (this *fileLogWriter) run() { for { - entry := <-this.queue + entry, open := <-this.queue + if !open { + break + } this.logger.Print(entry.String() + platform.LineSeparator()) entry.Release() entry = nil