mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
wined3d: Properly release the converted vertex declaration.
This commit is contained in:
parent
0feddccfe3
commit
7f5dccb696
@ -179,6 +179,11 @@ typedef struct IDirect3DDevice9Impl
|
||||
/* Avoids recursion with nested ReleaseRef to 0 */
|
||||
BOOL inDestruction;
|
||||
|
||||
/* A vertex declaration was converted from setFVF.
|
||||
* Keep track of it, so it can be properly freed
|
||||
*/
|
||||
IDirect3DVertexDeclaration9 *convertedDecl;
|
||||
|
||||
} IDirect3DDevice9Impl;
|
||||
|
||||
|
||||
|
@ -62,6 +62,8 @@ static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) {
|
||||
|
||||
if (ref == 0) {
|
||||
This->inDestruction = TRUE;
|
||||
if (This->convertedDecl != NULL)
|
||||
IUnknown_Release(This->convertedDecl);
|
||||
IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroyDepthStencilSurface, D3D9CB_DestroySwapChain);
|
||||
IWineD3DDevice_Release(This->WineD3DDevice);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
@ -766,6 +768,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF)
|
||||
|
||||
hr = IDirect3DDevice9Impl_SetVertexDeclaration(iface, pDecl);
|
||||
if (hr != S_OK) goto exit;
|
||||
This->convertedDecl = pDecl;
|
||||
pDecl = NULL;
|
||||
|
||||
exit:
|
||||
|
@ -360,6 +360,11 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9 ifa
|
||||
|
||||
TRACE("(%p) : Relay\n", iface);
|
||||
|
||||
if (This->convertedDecl && This->convertedDecl != pDecl) {
|
||||
IUnknown_Release(This->convertedDecl);
|
||||
This->convertedDecl = NULL;
|
||||
}
|
||||
|
||||
hr = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, pDeclImpl == NULL ? NULL : pDeclImpl->wineD3DVertexDeclaration);
|
||||
|
||||
return hr;
|
||||
|
Loading…
Reference in New Issue
Block a user