[vlc-commits] direct3d11: don't crash when exiting with an error

Steve Lhomme git at videolan.org
Mon Mar 23 18:11:58 CET 2015


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Mar 23 16:04:57 2015 +0100| [a5217fb83059b9a8372a9d913ba0ad6b62b4160b] | committer: Jean-Baptiste Kempf

direct3d11: don't crash when exiting with an error

It happens when opening the D3D11 device fails

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

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

 modules/video_output/msw/direct3d11.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index f8817e3..1adcde5 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -605,8 +605,10 @@ static void Direct3D11Close(vout_display_t *vd)
     vout_display_sys_t *sys = vd->sys;
 
     Direct3D11DestroyResources(vd);
-    ID3D11DeviceContext_Release(sys->d3dcontext);
-    ID3D11Device_Release(sys->d3ddevice);
+    if ( sys->d3dcontext )
+        ID3D11DeviceContext_Release(sys->d3dcontext);
+    if ( sys->d3ddevice )
+        ID3D11Device_Release(sys->d3ddevice);
     msg_Dbg(vd, "Direct3D11 device adapter closed");
 }
 



More information about the vlc-commits mailing list