LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET component in Labview

One more question.  I stumbled across this:

http://detritus.blogs.com/lycangeek/2006/05/how_to_say_good.html


I think I understand what he is saying.  My question is this: in the example above, does connecting the "Displacement1" property to a node cause a memory leak?  If so, how do you close this reference?
0 Kudos
Message 11 of 16
(938 Views)
The only part of that that would apply to the example I had posted is to add a Close for the myTester object. The wiring or not wiring of "Displacement1" has nothing to do with the article since "Displacement1" is not a reference.
0 Kudos
Message 12 of 16
(926 Views)
That makes sense to me.  I don't understand the part labeled "DON"T DO THIS" below:



What is the correct way of doing this?
0 Kudos
Message 13 of 16
(922 Views)
That's a memory leak because the reference from GetType() is being used, and so the reference gets created, but it's not closed. In the first example the GetType() element had no wire coming out of it so it was never used, and the reference was never created. The "DON'T DO THIS" should probably say "DON'T DO THIS WITHOUT CLOSING THIS REFERENCE", although the article alludes to this.
0 Kudos
Message 14 of 16
(919 Views)
So GetType() is a method?  How would you close it, once it is used?  Thanks for bearing with me!
0 Kudos
Message 15 of 16
(909 Views)
Yes, GetType is a method. You can tell because it's an Invoke Node (has a little arrow in the yellow bar). The others are Property nodes (have a little wrench in the yellow bar). That method would return a reference to a Type, if a wire is connected to it. You close that reference as shown in the second example of that figure.
0 Kudos
Message 16 of 16
(904 Views)