[vlc-commits] direct3d11: only report leaks when there's a debugger

Steve Lhomme git at videolan.org
Fri Jul 21 13:56:18 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Jul 19 11:09:27 2017 +0200| [fc421acf296f2a13771b4c9aeb2c7287c211010f] | committer: Jean-Baptiste Kempf

direct3d11: only report leaks when there's a debugger

It seems plenty of people have issues with d3d11_1sdklayers.dll being present
but not usable.
If a dev has the issue he can always disable this code section for testing.

In UWP we can assume it's present with MS build and no debug with mingw

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

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

 modules/video_output/win32/direct3d11.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 725bfc6539..893870b1f1 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1484,10 +1484,15 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
     HRESULT hr = S_OK;
 
 # if !defined(NDEBUG)
-    HINSTANCE sdklayer_dll = LoadLibrary(TEXT("d3d11_1sdklayers.dll"));
-    if (sdklayer_dll) {
-        creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
-        FreeLibrary(sdklayer_dll);
+#  if !VLC_WINSTORE_APP
+    if (IsDebuggerPresent())
+#  endif
+    {
+        HINSTANCE sdklayer_dll = LoadLibrary(TEXT("d3d11_1sdklayers.dll"));
+        if (sdklayer_dll) {
+            creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
+            FreeLibrary(sdklayer_dll);
+        }
     }
 # endif
 



More information about the vlc-commits mailing list