From 5ee7e44ed79feda9bc394e6f73f4fe0c62b8105b Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Sat, 25 Jan 2025 22:18:28 +0200 Subject: [PATCH] fix(tracker): ReadInstrument forgot to close the file --- CHANGELOG.md | 1 + tracker/files.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 453e1cf..823e81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). be computed every draw. ([#176][i176]) ### Fixed +- Loading instrument forgot to close the file (in model.ReadInstrument) - We try to honor the MIDI event time stamps, so that the timing between MIDI events (as reported to us by RTMIDI) will be correct. - When unmarshaling the recovery file, the unit parameter maps were "merged" diff --git a/tracker/files.go b/tracker/files.go index 35894dd..7ede74c 100644 --- a/tracker/files.go +++ b/tracker/files.go @@ -136,6 +136,7 @@ func (m *Model) LoadInstrument(r io.ReadCloser) bool { if err != nil { return false } + r.Close() // if we can't close the file, it's not a big deal, so ignore the error var instrument sointu.Instrument var errJSON, errYaml, err4ki, err4kp error var patch sointu.Patch