Close the file after read

Close the file when it has been full readed
This commit is contained in:
robbix1206 2016-08-31 16:40:45 +02:00
parent ae30611faf
commit 95fdc0a971

View file

@ -131,6 +131,10 @@ func loadSound() error {
// If this is the end of the file, just return.
if err == io.EOF || err == io.ErrUnexpectedEOF {
file.Close()
if err != nil {
return err
}
return nil
}