summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/dsound.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 61be8f44..fa0af41c 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -275,10 +275,13 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
if(SUCCEEDED(hr))
hr = IDirectSoundBuffer_Play(pData->DSsbuffer, 0, 0, DSBPLAY_LOOPING);
- device->ExtraData = pData;
- pData->thread = StartThread(DSoundProc, device);
- if(!pData->thread)
- hr = E_FAIL;
+ if(SUCCEEDED(hr))
+ {
+ device->ExtraData = pData;
+ pData->thread = StartThread(DSoundProc, device);
+ if(!pData->thread)
+ hr = E_FAIL;
+ }
if(FAILED(hr))
{