diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index 216cc6759..276c3c215 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -847,10 +847,14 @@ void AudioDisplay::SetFile(wxString file) { UpdateImage(); } catch (wxString &err) { + if (player) delete player; + if (provider) delete provider; wxLogDebug(_T("AudioDisplay::SetFile: gotcha!")); wxMessageBox(err,_T("Error loading audio"),wxICON_ERROR | wxOK); } } + + if (!loaded) return; assert(loaded == (provider != NULL));