d3d8: VertexShader should keep reference to the parent device object.

This commit is contained in:
Vitaliy Margolen 2006-04-11 22:09:27 -06:00 committed by Alexandre Julliard
parent 0fab85a5b6
commit 99136998e2
3 changed files with 6 additions and 0 deletions

View File

@ -531,6 +531,9 @@ struct IDirect3DVertexShader8Impl {
LONG ref;
IWineD3DVertexShader *wineD3DVertexShader;
/* Parent reference */
LPDIRECT3DDEVICE8 parentDevice;
};

View File

@ -1070,6 +1070,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface,
FIXME("(%p) : Number of shaders exceeds the maximum number of possible shaders\n", This);
hrc = E_OUTOFMEMORY;
} else {
IUnknown_AddRef(iface);
object->parentDevice = iface;
This->vShaders[i] = object;
*ppShader = i + VS_HIGHESTFIXEDFXF + 1;
}

View File

@ -56,6 +56,7 @@ ULONG WINAPI IDirect3DVertexShader8Impl_Release(IDirect3DVertexShader8 *iface) {
if (ref == 0) {
IWineD3DVertexShader_Release(This->wineD3DVertexShader);
IUnknown_Release(This->parentDevice);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;