safer for loop

pull/131/head
v2ray 2016-05-01 17:19:09 +02:00
parent b453288e04
commit 3df7634570
1 changed files with 3 additions and 1 deletions

View File

@ -54,9 +54,11 @@ func (this *fileLogWriter) Log(log LogEntry) {
}
func (this *fileLogWriter) run() {
for entry := range this.queue {
for {
entry := <-this.queue
this.logger.Print(entry.String() + platform.LineSeparator())
entry.Release()
entry = nil
}
}