d3d8: VertexShader should keep reference to the parent device object.
This commit is contained in:
parent
0fab85a5b6
commit
99136998e2
|
@ -531,6 +531,9 @@ struct IDirect3DVertexShader8Impl {
|
|||
LONG ref;
|
||||
|
||||
IWineD3DVertexShader *wineD3DVertexShader;
|
||||
|
||||
/* Parent reference */
|
||||
LPDIRECT3DDEVICE8 parentDevice;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue