From c9b931187ba21c472d281e44434f9dce7a76bdeb Mon Sep 17 00:00:00 2001 From: Claire Novotny Date: Fri, 19 Feb 2021 08:05:48 -0500 Subject: [PATCH] Fix warnings about null checks --- .../WindowsDesktop/GraphicsTelemetryInitializer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppInsights.WindowsDesktop/WindowsDesktop/GraphicsTelemetryInitializer.cs b/AppInsights.WindowsDesktop/WindowsDesktop/GraphicsTelemetryInitializer.cs index 50752ec..6abd5c3 100644 --- a/AppInsights.WindowsDesktop/WindowsDesktop/GraphicsTelemetryInitializer.cs +++ b/AppInsights.WindowsDesktop/WindowsDesktop/GraphicsTelemetryInitializer.cs @@ -90,8 +90,8 @@ private static double GetFeatureLevel() out deviceOut, out featureLevelRef, out immediateContextOut); - if (deviceOut != null) Marshal.Release(deviceOut); - if (immediateContextOut != null) Marshal.Release(immediateContextOut); + if (deviceOut != IntPtr.Zero) Marshal.Release(deviceOut); + if (immediateContextOut != IntPtr.Zero) Marshal.Release(immediateContextOut); if (featureLevelRef <= D3D_FEATURE_LEVEL_9_1) return 9.1; if (featureLevelRef <= D3D_FEATURE_LEVEL_9_2) return 9.2; if (featureLevelRef <= D3D_FEATURE_LEVEL_9_3) return 9.3;