[vlc-commits] Direct3D9: release compile shader buffers

Hannes Domani git at videolan.org
Sun Feb 8 16:18:25 CET 2015


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Sun Feb  8 13:19:00 2015 +0100| [7296c976a0821af80626594580a3ee233fccb3b2] | committer: Jean-Baptiste Kempf

Direct3D9: release compile shader buffers

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7296c976a0821af80626594580a3ee233fccb3b2
---

 modules/video_output/msw/direct3d9.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/msw/direct3d9.c b/modules/video_output/msw/direct3d9.c
index c4335ae..d3c33af 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;



More information about the vlc-commits mailing list