dmusic: Set the dsound pointer to NULL on an error path.
Spotted by Sebastian Lackner. Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
01c6b4fe64
commit
3b4909fd94
|
@ -298,8 +298,10 @@ static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDi
|
|||
return hr;
|
||||
hr = IDirectSound_SetCooperativeLevel(This->dsound, hwnd ? hwnd : GetForegroundWindow(),
|
||||
DSSCL_PRIORITY);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(hr)) {
|
||||
IDirectSound_Release(This->dsound);
|
||||
This->dsound = NULL;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue