Commit ae91cfe3 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: SetClipper refcounting fix.

parent 266fc77c
......@@ -1882,17 +1882,18 @@ IDirectDrawSurfaceImpl_SetClipper(IDirectDrawSurface7 *iface,
IDirectDrawClipper *Clipper)
{
ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface);
IDirectDrawClipperImpl *oldClipper = This->clipper;
TRACE("(%p)->(%p)\n",This,Clipper);
if (ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper) == This->clipper)
return DD_OK;
if (This->clipper != NULL)
IDirectDrawClipper_Release(ICOM_INTERFACE(This->clipper, IDirectDrawClipper) );
This->clipper = ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper);
if (Clipper != NULL)
IDirectDrawClipper_AddRef(Clipper);
if(oldClipper)
IDirectDrawClipper_Release(ICOM_INTERFACE(oldClipper, IDirectDrawClipper));
return DD_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment