Explorar o código

Fixed wait cursor not being disposed when exceptions happen in DYnamicGrid.Refresh

Kenric Nugteren hai 10 meses
pai
achega
487cc165e3
Modificáronse 1 ficheiros con 1 adicións e 7 borrados
  1. 1 7
      inabox.wpf/DynamicGrid/DynamicGrid.cs

+ 1 - 7
inabox.wpf/DynamicGrid/DynamicGrid.cs

@@ -1022,7 +1022,7 @@ public abstract class DynamicGrid<T> : DynamicGrid, IDynamicGridUIComponentParen
 
         UIComponent.BeforeRefresh();
 
-        var cursor = UseWaitCursor ? new WaitCursor() : null;
+        using var cursor = UseWaitCursor ? new WaitCursor() : null;
 
         Loading.Visibility = Visibility.Visible;
         Loading.BeginAnimation(Label.OpacityProperty, LoadingFader);
@@ -1103,12 +1103,6 @@ public abstract class DynamicGrid<T> : DynamicGrid, IDynamicGridUIComponentParen
             Loading.BeginAnimation(Label.OpacityProperty, null);
             Loading.Visibility = Visibility.Collapsed;
         }
-
-        if (cursor != null)
-        {
-            cursor.Dispose();
-            cursor = null;
-        }
     }
 
     public void Shutdown()