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:
@@ -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
|
||||
|
Reference in New Issue
Block a user