ddraw: SetClipper refcounting fix.
This commit is contained in:
parent
266fc77cf0
commit
ae91cfe380
|
@ -1882,17 +1882,18 @@ IDirectDrawSurfaceImpl_SetClipper(IDirectDrawSurface7 *iface,
|
||||||
IDirectDrawClipper *Clipper)
|
IDirectDrawClipper *Clipper)
|
||||||
{
|
{
|
||||||
ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface);
|
ICOM_THIS_FROM(IDirectDrawSurfaceImpl, IDirectDrawSurface7, iface);
|
||||||
|
IDirectDrawClipperImpl *oldClipper = This->clipper;
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n",This,Clipper);
|
TRACE("(%p)->(%p)\n",This,Clipper);
|
||||||
if (ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper) == This->clipper)
|
if (ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper) == This->clipper)
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
|
|
||||||
if (This->clipper != NULL)
|
|
||||||
IDirectDrawClipper_Release(ICOM_INTERFACE(This->clipper, IDirectDrawClipper) );
|
|
||||||
|
|
||||||
This->clipper = ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper);
|
This->clipper = ICOM_OBJECT(IDirectDrawClipperImpl, IDirectDrawClipper, Clipper);
|
||||||
|
|
||||||
if (Clipper != NULL)
|
if (Clipper != NULL)
|
||||||
IDirectDrawClipper_AddRef(Clipper);
|
IDirectDrawClipper_AddRef(Clipper);
|
||||||
|
if(oldClipper)
|
||||||
|
IDirectDrawClipper_Release(ICOM_INTERFACE(oldClipper, IDirectDrawClipper));
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue