Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Properly dispose of IMAQImage displayed on front panel

I believe I have a memory leak in my program where my vision VI passes an IMAQImage back to my main VI for displaying on the front panel.  I am displaying the image in (what Context Help tells me is...) a " typedef 'IMAQ Image.ctl' ".  It looks like this:  dfhBkK0

When I later want to dispose of this image (before I load a new one into the display) I get a property node of the value of the display (typedef IMAQ Image.ctl), which is a Variant and I can't use IMAQ Dispose with that.  I tried finding another property node where I could get the actual image data out of the display but couldn't find anything (The Invoke Node "Get Image" doesn't return an IMAQImage).

 

One thing I tried is assigning the output of that vision VI to a regular IMAQImage control (one that shows on the front panel as a textbox with "I/O" on the left [looks like this], not the display version above), in addition to the display above.  I was able to do that, and get a value property node that I could use with IMAQDispose, but I still see my memory usage creeping higher and higher over time.  Maybe I now have two copies of the image and I am only disposing of one?

 

One of my problems is that I still don't understand why both the display above and the textbox that has "I/O" on the left are both called "IMAQImage".  It's like I "lose" access to the "real" image once I put it in that display.  What is the proper way to retain access to the "real" image so that I can dispose of it later?  Am I going about disposing of these images in a completely wrong way?

0 Kudos
Message 1 of 1
(737 Views)