Browse Source

Close opened files

pull/1842/head
Jae Kwon 8 years ago
parent
commit
0416e0aa9c
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      group.go

+ 4
- 0
group.go View File

@ -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


Loading…
Cancel
Save