From 478a414e5820c56fb7bb65d0c41c831932ca26e8 Mon Sep 17 00:00:00 2001 From: Markus Amsler Date: Mon, 20 Nov 2006 10:47:37 +0100 Subject: [PATCH] d3d: Remove AddRef from IWineD3DDevice_GetBackBuffer. --- dlls/d3d8/device.c | 1 - dlls/d3d8/swapchain.c | 1 - dlls/d3d9/device.c | 1 - dlls/d3d9/swapchain.c | 1 - dlls/ddraw/ddraw.c | 3 --- dlls/wined3d/swapchain.c | 2 -- 6 files changed, 9 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index e1289301a4b..429b918e74a 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -295,7 +295,6 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, 0, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, (IWineD3DSurface **)&retSurface); if (rc == D3D_OK && NULL != retSurface && NULL != ppBackBuffer) { IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer); - IWineD3DSurface_Release(retSurface); } return rc; } diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c index f5b75d871b1..9012b35e72c 100644 --- a/dlls/d3d8/swapchain.c +++ b/dlls/d3d8/swapchain.c @@ -80,7 +80,6 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE )Type, &mySurface); if (hrc == D3D_OK && NULL != mySurface) { IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer); - IWineD3DSurface_Release(mySurface); } return hrc; } diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2ebb677c271..8ed7b8d3045 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -205,7 +205,6 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 ifa rc = IWineD3DDevice_GetBackBuffer(This->WineD3DDevice, iSwapChain, BackBuffer, (WINED3DBACKBUFFER_TYPE) Type, (IWineD3DSurface **)&retSurface); if (rc == D3D_OK && NULL != retSurface && NULL != ppBackBuffer) { IWineD3DSurface_GetParent(retSurface, (IUnknown **)ppBackBuffer); - IWineD3DSurface_Release(retSurface); } return rc; } diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index 0b06049a946..a4007ad01ee 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -88,7 +88,6 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN9 hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE) Type, &mySurface); if (hrc == D3D_OK && NULL != mySurface) { IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer); - IWineD3DSurface_Release(mySurface); } /* Do not touch the **ppBackBuffer pointer otherwise! (see device test) */ return hrc; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 11de3ef3eb9..de3c704f3ef 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1212,9 +1212,6 @@ IDirectDrawImpl_GetGDISurface(IDirectDraw7 *iface, return DDERR_NOTFOUND; } - /* GetBackBuffer AddRef()ed the surface, release it */ - IWineD3DSurface_Release(Surf); - IWineD3DSurface_GetParent(Surf, (IUnknown **) &ddsurf); IDirectDrawSurface7_Release(ddsurf); /* For the GetParent */ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index b9bf032f4df..4e8f97fbeed 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -461,8 +461,6 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetBackBuffer(IWineD3DSwapChain *ifa *ppBackBuffer = This->backBuffer[iBackBuffer]; TRACE("(%p) : BackBuf %d Type %d returning %p\n", This, iBackBuffer, Type, *ppBackBuffer); - /* Note inc ref on returned surface */ - if(*ppBackBuffer) IWineD3DSurface_AddRef(*ppBackBuffer); return WINED3D_OK; }