fix crash if DirectSoundCreate fails (eg. no sound devices)
This commit is contained in:
@@ -103,6 +103,7 @@ DSound::DSound()
|
|||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
if( FAILED( hr = CoInitialize(NULL) ) )
|
if( FAILED( hr = CoInitialize(NULL) ) )
|
||||||
RageException::Throw( hr_ssprintf(hr, "CoInitialize") );
|
RageException::Throw( hr_ssprintf(hr, "CoInitialize") );
|
||||||
|
m_pDS = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CString DSound::Init()
|
CString DSound::Init()
|
||||||
@@ -143,6 +144,7 @@ CString DSound::Init()
|
|||||||
|
|
||||||
DSound::~DSound()
|
DSound::~DSound()
|
||||||
{
|
{
|
||||||
|
if( m_pDS != NULL )
|
||||||
m_pDS->Release();
|
m_pDS->Release();
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user