Hopefully fix memory leak

This commit is contained in:
Mike Nolan 2024-01-10 04:32:08 +00:00
parent 90adb11b6a
commit 83fbbef8b4
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ public class PictureBox : Panel
public void SetImage(Image<Rgb24> image) public void SetImage(Image<Rgb24> image)
{ {
lockObj.Lock(()=>{ lockObj.Lock(()=>{
if(img != null)
{
img.Dispose();
}
img=image; img=image;
if(img !=null) if(img !=null)
{ {