Close the file when it has been full readed
@@ -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
}