NIRfsg.Dispose Method
- Updated2024-05-08
- 1 minute(s) read
NIRfsgDispose Method
Closes the specified session and deallocates the reserved resources, if not already disposed.
Namespace: NationalInstruments.ModularInstruments.NIRfsg
Assembly: NationalInstruments.ModularInstruments.NIRfsg.Fx40 (in NationalInstruments.ModularInstruments.NIRfsg.Fx40.dll) Version: 2022
Syntax
Remarks
You can call this method safely more than once, even if the session is already closed.
A call to this method disposes the SafeHandle class used to hold the instrument handle. If the call to this method fails due to some reason, like the session being closed by some external means, you will not be notified about the failure. To help you identify failures in the ReleaseHandle method of the SafeHandle class, managed debugging assistant (MDA) is activated.
For details refer to http://msdn.microsoft.com/en-us/library/85eak4a0.aspx.
The call to this method fails when you externally close a session by:
- Initializing a session with a resource name for which the session is already open, within the same process. This causes the instrument handle held by the existing session to become invalid.
- Getting the instrument handle out using the GetInstrumentHandle method and closing this handle directly.