wined3d: Don't leak memory in IWineD3DPixelShaderImpl_GenerateShader().

This fixes a regression introduced by commit
0bf32b12f5.
This commit is contained in:
Henri Verbeet 2008-12-09 09:52:38 +01:00 committed by Alexandre Julliard
parent f1f62fb5ce
commit acbdd807b6
1 changed files with 6 additions and 1 deletions

View File

@ -275,13 +275,18 @@ static void pshader_set_limits(
static inline GLuint IWineD3DPixelShaderImpl_GenerateShader(
IWineD3DPixelShaderImpl *This) {
SHADER_BUFFER buffer;
GLuint shader;
buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE);
buffer.bsize = 0;
buffer.lineNo = 0;
buffer.newline = TRUE;
return ((IWineD3DDeviceImpl *)This->baseShader.device)->shader_backend->shader_generate_pshader((IWineD3DPixelShader *) This, &buffer);
shader = ((IWineD3DDeviceImpl *)This->baseShader.device)->shader_backend->shader_generate_pshader((IWineD3DPixelShader *)This, &buffer);
HeapFree(GetProcessHeap(), 0, buffer.buffer);
return shader;
}
static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, CONST DWORD *pFunction) {