From 3362b61f73a538167f09b277e7c600196cac336b Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Mon, 9 Jul 2007 11:52:28 +0000 Subject: [PATCH] Hopefully fix assertion failure when audio provider creation succeeds but audio player fails to init. Originally committed to SVN as r1397. --- aegisub/audio_display.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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));