Procházet zdrojové kódy

detect end of channel

v2ray před 9 roky
rodič
revize
a538de56de
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  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