magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Goroutine leak in parser #2

Closed magiconair closed 9 years ago

magiconair commented 9 years ago

After parsing some input there is still a goroutine with a lexer around which will never be cleaned up. Parsing a lot of inputs leaks a goroutine per input.

You'll notice it in the goroutine dump as something similar to this:

goroutine 21 [chan send]:
github.com/magiconair/properties.(*lexer).emit(0xc208004240, 0x2)
    /Users/frschroeder/gopath/src/github.com/magiconair/properties/lex.go:99 +0xb9
github.com/magiconair/properties.lexKey(0xc208004240, 0x414148)
    /Users/frschroeder/gopath/src/github.com/magiconair/properties/lex.go:250 +0x132
github.com/magiconair/properties.(*lexer).run(0xc208004240)
    /Users/frschroeder/gopath/src/github.com/magiconair/properties/lex.go:177 +0x4e
created by github.com/magiconair/properties.lex
    /Users/frschroeder/gopath/src/github.com/magiconair/properties/lex.go:170 +0xce
magiconair commented 9 years ago

Fixed in v1.4.2