From 83fbbef8b4aa5ec0fc3550c13a87a712f65db182 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Wed, 10 Jan 2024 04:32:08 +0000 Subject: [PATCH] Hopefully fix memory leak --- Timelapse/PictureBox.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Timelapse/PictureBox.cs b/Timelapse/PictureBox.cs index 19dbb32..78b46c7 100644 --- a/Timelapse/PictureBox.cs +++ b/Timelapse/PictureBox.cs @@ -34,6 +34,10 @@ public class PictureBox : Panel public void SetImage(Image image) { lockObj.Lock(()=>{ + if(img != null) + { + img.Dispose(); + } img=image; if(img !=null) {