From: Hannes Domani Date: Sun, 8 Feb 2015 12:19:00 +0000 (+0100) Subject: Direct3D9: release compile shader buffers X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7296c976a0821af80626594580a3ee233fccb3b2;hp=0cee6c308ae964104b311b66b087fc0c6b9a9fc6;p=vlc Direct3D9: release compile shader buffers Signed-off-by: Jean-Baptiste Kempf --- diff --git a/modules/video_output/msw/direct3d9.c b/modules/video_output/msw/direct3d9.c index c4335ae67c..d3c33af3d4 100644 --- a/modules/video_output/msw/direct3d9.c +++ b/modules/video_output/msw/direct3d9.c @@ -1213,8 +1213,10 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source, if (FAILED(hr)) { msg_Warn(vd, "D3DXCompileShader Error (hr=0x%lX)", hr); - if (error_msgs) + if (error_msgs) { msg_Warn(vd, "HLSL Compilation Error: %s", (char*)ID3DXBuffer_GetBufferPointer(error_msgs)); + ID3DXBuffer_Release(error_msgs); + } return VLC_EGENERIC; } @@ -1222,6 +1224,11 @@ static int Direct3D9CompileShader(vout_display_t *vd, const char *shader_source, ID3DXBuffer_GetBufferPointer(compiled_shader), &sys->d3dx_shader); + if (compiled_shader) + ID3DXBuffer_Release(compiled_shader); + if (error_msgs) + ID3DXBuffer_Release(error_msgs); + if (FAILED(hr)) { msg_Warn(vd, "IDirect3DDevice9_CreatePixelShader error (hr=0x%lX)", hr); return VLC_EGENERIC;