10 May
2017
10 May
'17
10:44 p.m.
On 10.05.2017 15:13, Michael Stefaniuc wrote:
+ + if (This->dsound) + IDirectSound_Release(This->dsound); + + if (!dsound) { + hr = DirectSoundCreate8(NULL, (IDirectSound8 **)&This->dsound, NULL); + if (FAILED(hr)) + return hr; + hr = IDirectSound_SetCooperativeLevel(This->dsound, hwnd ? hwnd : GetForegroundWindow(), + DSSCL_PRIORITY); + if (FAILED(hr)) + IDirectSound_Release(This->dsound); + return hr; + }
Shouldn't you unset This->dsound in the error paths (especially the last one)?