fix crash if RageSoundManager or SongManager throw

This commit is contained in:
Glenn Maynard
2003-02-16 05:10:08 +00:00
parent 3f9504b7b9
commit 3b8d26e564
2 changed files with 25 additions and 13 deletions
+12 -5
View File
@@ -20,13 +20,20 @@ RageSoundManager::RageSoundManager(CString drivers)
{
/* needs to be done first */
SOUNDMAN = this;
MixVolume = 1.0f;
driver = MakeRageSoundDriver(drivers);
if(!driver)
RageException::Throw("Couldn't find a sound driver that works");
try
{
MixVolume = 1.0f;
music = new RageSound;
driver = MakeRageSoundDriver(drivers);
if(!driver)
RageException::Throw("Couldn't find a sound driver that works");
music = new RageSound;
} catch(...) {
SOUNDMAN = NULL;
throw;
}
}
RageSoundManager::~RageSoundManager()