Hopefully fix assertion failure when audio provider creation succeeds but audio player fails to init.

Originally committed to SVN as r1397.
This commit is contained in:
Niels Martin Hansen 2007-07-09 11:52:28 +00:00
parent befce025c0
commit 3362b61f73
1 changed files with 4 additions and 0 deletions

View File

@ -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));