mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-27 10:32:44 +00:00
Close opened files
This commit is contained in:
@@ -444,6 +444,7 @@ func (g *Group) readGroupInfo() GroupInfo {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer dir.Close()
|
||||
fiz, err := dir.Readdir(0)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -598,6 +599,9 @@ func (gr *GroupReader) openFile(index int) error {
|
||||
curReader := bufio.NewReader(curFile)
|
||||
|
||||
// Update gr.cur*
|
||||
if gr.curFile != nil {
|
||||
gr.curFile.Close() // TODO return error?
|
||||
}
|
||||
gr.curIndex = index
|
||||
gr.curFile = curFile
|
||||
gr.curReader = curReader
|
||||
|
||||
Reference in New Issue
Block a user