[PATCH 3/6 v2] dmusic: Implement IDirectMusic8::SetDirectSound()

Sebastian Lackner sebastian at fds-team.de
Wed May 10 17:44:50 CDT 2017


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)?



More information about the wine-devel mailing list