From b43c374d86bd633f89fea316df84d1e77d363be2 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 17 Aug 2022 08:49:45 +0200 Subject: [PATCH] Properly use DeleteShape --- ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 3820579dd..168c469a1 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -1672,8 +1672,7 @@ public void CollapseAllHorizontal(float x, float width) foreach (BaseShape shape in toDelete) { - shape.Dispose(); - Shapes.Remove(shape); + DeleteShape(shape); } } @@ -1726,8 +1725,7 @@ public void CollapseAllVertical(float y, float height) foreach (BaseShape shape in toDelete) { - shape.Dispose(); - Shapes.Remove(shape); + DeleteShape(shape); } }