]> git.sesse.net Git - vlc/commitdiff
Direct3D9: release compile shader buffers
authorHannes Domani <ssbssa@yahoo.de>
Sun, 8 Feb 2015 12:19:00 +0000 (13:19 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 8 Feb 2015 15:02:26 +0000 (16:02 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/msw/direct3d9.c

index c4335ae67cae9aaf2a89ab140a4003ab234dcac0..d3c33af3d400026e8097fa7db05d9f138a4046e8 100644 (file)
@@ -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;