소스 검색

detect end of channel

v2ray 9 년 전
부모
커밋
a538de56de
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      common/log/log_writer.go

+ 4 - 1
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