From b9193cc93ffedfac241a61ab7a350b8feb30179d Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Mon, 6 Feb 2006 11:31:57 +0100 Subject: [PATCH] wined3d: Release the correct vertexdeclaration in IWineD3DDeviceImpl_SetVertexDeclaration. --- dlls/wined3d/device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6277ff52892..6b1d3cf3aec 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3773,6 +3773,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetScissorRect(IWineD3DDevice *iface, RECT* pR HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* iface, IWineD3DVertexDeclaration* pDecl) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; + IWineD3DVertexDeclaration *oldDecl = This->updateStateBlock->vertexDecl; TRACE("(%p) : pDecl=%p\n", This, pDecl); @@ -3787,8 +3788,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* iface, IW if (NULL != pDecl) { IWineD3DVertexDeclaration_AddRef(pDecl); } - if (NULL != This->updateStateBlock->vertexDecl) { - IWineD3DVertexDeclaration_Release(This->updateStateBlock->vertexDecl); + if (NULL != oldDecl) { + IWineD3DVertexDeclaration_Release(oldDecl); } return D3D_OK; }