Hopefully fix memory leak
This commit is contained in:
parent
90adb11b6a
commit
83fbbef8b4
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue