[vlc-devel] [PATCH] direct3d11: don't crash when exiting with an error
Steve Lhomme
robux4 at videolabs.io
Mon Mar 23 16:04:57 CET 2015
It happens when opening the D3D11 device fails
---
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 b673e05..a9189da 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");
}
--
2.3.0
More information about the vlc-devel
mailing list