Engine.DoDotNetGarbageCollection
- Updated2024-10-09
- 2 minute(s) read
Engine.DoDotNetGarbageCollection
Syntax
Engine.DoDotNetGarbageCollection( reserved = 0)
Purpose
Forces .NET garbage collection and waits for pending finalizers to ensure that all unreferenced COM objects that have ever been referenced in .NET in the TestStand process are synchronously freed.
For example, if you are handling events from any of the TestStand User Interface (UI) controls in a .NET user interface, .NET references all the parameters to all the events for the TestStand UI Control. The lifetimes of these parameters are extended until garbage collection occurs. When you use .NET to handle any event on an ActiveX control, such as a TestStand UI Control, the .NET Framework handles all events for that control even if you do not handle the events directly in code.
In addition, if sequences pass TestStand interface objects as parameters to .NET code modules, .NET references those parameters, which extends the lifetimes of those parameters until garbage collection occurs.
Remarks
You typically do not need to call this method because TestStand automatically calls this method at various critical points, such as when an execution completes or when a sequence file or execution closes.
Parameters
reserved As Long
[In] Reserved for future use. You must always pass 0 for this parameter.
This parameter has a default value of 0 .