release method
Decrements the reference count of this COM object.
If this is the last reference to the object, the COM object is destroyed, and its resources are freed. Ensure that you do not access the object after calling release if its reference count reaches zero.
Example:
// Create a new COM object instance (e.g., IFileDialog).
final fileDialog = createInstance<IFileDialog>(FileOpenDialog);
// Perform some operations with the file dialog instance.
// ...
// Later, when done with the file dialog:
fileDialog.release(); // Ensures resources are freed immediately.
To learn more, see learn.microsoft.com/windows/win32/api/unknwn/nf-unknwn-iunknown-release.
Implementation
@pragma('vm:prefer-inline')
int release() => _ReleaseFn(ptr);