Commit 4a25828c authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

d3d9: VertexDeclaration and VertexShader should keep reference to the parent device object.

parent 99136998
......@@ -541,6 +541,8 @@ typedef struct IDirect3DVertexDeclaration9Impl {
/* IDirect3DVertexDeclaration9 fields */
IWineD3DVertexDeclaration *wineD3DVertexDeclaration;
/* Parent reference */
LPDIRECT3DDEVICE9 parentDevice;
} IDirect3DVertexDeclaration9Impl;
/* ---------------------- */
......@@ -563,6 +565,8 @@ typedef struct IDirect3DVertexShader9Impl {
/* IDirect3DVertexShader9 fields */
IWineD3DVertexShader *wineD3DVertexShader;
/* Parent reference */
LPDIRECT3DDEVICE9 parentDevice;
} IDirect3DVertexShader9Impl;
/* --------------------- */
......
......@@ -56,6 +56,7 @@ ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECLARATION
if (ref == 0) {
IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration);
IUnknown_Release(This->parentDevice);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -129,6 +130,8 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9
FIXME("(%p) call to IWineD3DDevice_CreateVertexDeclaration failed\n", This);
HeapFree(GetProcessHeap(), 0, object);
} else {
IUnknown_AddRef(iface);
object->parentDevice = iface;
*ppDecl = (LPDIRECT3DVERTEXDECLARATION9) object;
TRACE("(%p) : Created vertex declatanio %p\n", This, object);
}
......
......@@ -56,6 +56,7 @@ ULONG WINAPI IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 iface) {
if (ref == 0) {
IWineD3DVertexShader_Release(This->wineD3DVertexShader);
IUnknown_Release(This->parentDevice);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -122,6 +123,8 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9 iface,
FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n");
HeapFree(GetProcessHeap(), 0, object);
}else{
IUnknown_AddRef(iface);
object->parentDevice = iface;
*ppShader = (IDirect3DVertexShader9 *)object;
TRACE("(%p) : Created vertex shader %p\n", This, object);
}
......
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