Browse Source

Merge pull request #951 from AvaloniaUI/sharpdx-enable-release-on-finalizer

Enable SharpDX EnableReleaseOnFinalizer.
Steven Kirk 8 years ago
parent
commit
66cc4d59a5
1 changed files with 12 additions and 8 deletions
  1. 12 8
      src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

+ 12 - 8
src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

@@ -72,14 +72,18 @@ namespace Avalonia.Direct2D1
             }
         }
 
-        public static void Initialize() => AvaloniaLocator.CurrentMutable
-            .Bind<IPlatformRenderInterface>().ToConstant(s_instance)
-            .Bind<IRendererFactory>().ToConstant(s_instance)
-            .BindToSelf(s_d2D1Factory)
-            .BindToSelf(s_dwfactory)
-            .BindToSelf(s_imagingFactory)
-            .BindToSelf(s_dxgiDevice)
-            .BindToSelf(s_d2D1Device);
+        public static void Initialize()
+        {
+            AvaloniaLocator.CurrentMutable
+                        .Bind<IPlatformRenderInterface>().ToConstant(s_instance)
+                        .Bind<IRendererFactory>().ToConstant(s_instance)
+                        .BindToSelf(s_d2D1Factory)
+                        .BindToSelf(s_dwfactory)
+                        .BindToSelf(s_imagingFactory)
+                        .BindToSelf(s_dxgiDevice)
+                        .BindToSelf(s_d2D1Device);
+            SharpDX.Configuration.EnableReleaseOnFinalizer = true;
+        }
 
         public IBitmapImpl CreateBitmap(int width, int height)
         {