1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

Bug1354: Importing MIDI via Import Audio... and list-of-files should undo...

... also fixes a possible memory leak in direct Import MIDI... along the
failure path.
This commit is contained in:
Paul Licameli
2016-03-14 11:02:09 -04:00
parent 919712e3f7
commit 4cf9e0e6d6
3 changed files with 23 additions and 20 deletions

View File

@@ -379,12 +379,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
if (targetfile.AfterLast(wxT('.')).IsSameAs(wxT("mid"), false)
|| targetfile.AfterLast(wxT('.')).IsSameAs(wxT("midi"), false))
{
NoteTrack *nTrack = new NoteTrack(mProject->GetDirManager());
if (::ImportMIDI(targetfile, nTrack))
mProject->GetTracks()->Add(nTrack);
else
delete nTrack;
mProject->DoImportMIDI(targetfile);
}
// If not a midi, open audio file