Dispose Method

Microsoft Deployment Tools

Deployment Tools Foundation Dispose Method
Closes the handle. After closing a handle, further method calls may throw an InvalidHandleException.
Declaration Syntax
C# Visual Basic Visual C++
public void Dispose()
Public Sub Dispose
public:
virtual void Dispose() sealed
Remarks

The finalizer of this class will NOT close the handle if it is still open, because finalization can run on a separate thread from the application, resulting in potential problems if handles are closed from that thread. It is best that the handle be closed manually as soon as it is no longer needed, as leaving lots of unused handles open can degrade performance.

Win32 MSI API: MsiCloseHandle

See Also

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller) Version: 3.0.0.0 (3.5.1623.0)