Close audio if an error occurs while announcing the opened audio as the program is probably in an inconsistent state

Originally committed to SVN as r5946.
This commit is contained in:
Thomas Goyne 2011-11-30 04:28:03 +00:00
parent b4d2bba7a2
commit f0e98151f1

View file

@ -331,9 +331,17 @@ void AudioController::OpenAudio(const wxString &url)
video_position_marker_provider->AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); video_position_marker_provider->AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved)));
} }
try
{
// Tell listeners about this. // Tell listeners about this.
AnnounceAudioOpen(provider); AnnounceAudioOpen(provider);
} }
catch (...)
{
CloseAudio();
throw;
}
}
void AudioController::CloseAudio() void AudioController::CloseAudio()