From acbdd807b6164e155357a9c8a49692dc574d7e20 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 9 Dec 2008 09:52:38 +0100 Subject: [PATCH] wined3d: Don't leak memory in IWineD3DPixelShaderImpl_GenerateShader(). This fixes a regression introduced by commit 0bf32b12f5a97045c4c2785260961e53184c29ce. --- dlls/wined3d/pixelshader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 0557d86f1bb..6a4d7d5dc5c 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -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) { -- 2.11.4.GIT