NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Life time of references

In TestStand I created an activeX object by selecting the "Create Object" box in the activeX API the first time a method was called on that object. A reference was saved to the object, and was specified in the "ActiveX Reference" box.
Do I need to free this created ActiveX object? If so how do I free and ActiveX object?
0 Kudos
Message 1 of 2
(2,963 Views)
Your object is released (freed) when the last variable that references it goes out of scope.

Local variables go out of scope at the end of the sequence. File globals go out of scope at the end of their execution. Station globals go out of scope when you shutdown TestStand.

You can explicitly release an object reference by setting the variable that references the object to a value of Nothing in a statement step or other expression. For example:

locals.myObject = Nothing
0 Kudos
Message 2 of 2
(2,963 Views)