Прочетете на английски Редактиране

Споделяне чрез


SearchResultCollection.Dispose Method

Definition

Releases all resources that are used by the SearchResultCollection object.

Overloads

Dispose()

Releases all resources that are used by the SearchResultCollection object.

Dispose(Boolean)

Releases the unmanaged resources that are used by the SearchResultCollection object and optionally releases the managed resources.

Dispose()

Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs

Releases all resources that are used by the SearchResultCollection object.

C#
public void Dispose();

Implements

Remarks

The Dispose method, it allows the resources that are used by the SearchResultCollection to be reallocated for other purposes. For more information about Dispose, see Cleaning Up Unmanaged Resources.

The garbage collector does not release memory for a SearchResultCollection object. Therefore, an application must call the Dispose method explicitly to prevent a memory leak.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Dispose(Boolean)

Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs
Source:
SearchResultCollection.cs

Releases the unmanaged resources that are used by the SearchResultCollection object and optionally releases the managed resources.

C#
protected virtual void Dispose(bool disposing);

Parameters

disposing
Boolean

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose method and the Finalize() method, if it has been overridden. Dispose invokes the protected Dispose method with the disposing parameter set to true. Finalize invokes Dispose with the disposing parameter set to false.

When the disposing parameter is true, this method releases all resources that are held by any managed objects that this SearchResultCollection references.

The garbage collector does not release memory for a SearchResultCollection object. Therefore, you must call the Dispose method explicitly to prevent a memory leak.

This method invokes the Dispose method of each object in the collection.

For more information about Dispose() and Finalize, see Cleaning Up Unmanaged Resources and Overriding the Finalize Method.

Notes to Inheritors

The Dispose() method can be called multiple times by other objects. When overriding the Dispose(Boolean) method be careful not to reference objects that have been previously disposed of in an earlier call to the Dispose() method. For more information about how to implement Dispose(), see Implementing a Dispose Method.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10