fix crash if DirectSoundCreate fails (eg. no sound devices)

This commit is contained in:
Glenn Maynard
2005-10-22 03:10:53 +00:00
parent 59fb0dbe41
commit 3044155ce8
+3 -1
View File
@@ -103,6 +103,7 @@ DSound::DSound()
HRESULT hr;
if( FAILED( hr = CoInitialize(NULL) ) )
RageException::Throw( hr_ssprintf(hr, "CoInitialize") );
m_pDS = NULL;
}
CString DSound::Init()
@@ -143,7 +144,8 @@ CString DSound::Init()
DSound::~DSound()
{
m_pDS->Release();
if( m_pDS != NULL )
m_pDS->Release();
CoUninitialize();
}