DeriveBytes.Dispose Метод
Определение
При переопределении в производном классе освобождает все ресурсы, используемые текущим объектом DeriveBytes.When overridden in a derived class, releases all resources used by the current instance of the DeriveBytes class.
Перегрузки
Dispose() |
При переопределении в производном классе освобождает все ресурсы, используемые текущим объектом DeriveBytes.When overridden in a derived class, releases all resources used by the current instance of the DeriveBytes class. |
Dispose(Boolean) |
Если переопределено в производном классе, освобождает неуправляемые ресурсы, используемые классом DeriveBytes, и опционально освобождает управляемые ресурсы.When overridden in a derived class, releases the unmanaged resources used by the DeriveBytes class and optionally releases the managed resources. |
Dispose()
При переопределении в производном классе освобождает все ресурсы, используемые текущим объектом DeriveBytes.When overridden in a derived class, releases all resources used by the current instance of the DeriveBytes class.
public:
virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()
Реализации
Комментарии
Вызовите метод Dispose
по окончании использования класса DeriveBytes.Call Dispose
when you are finished using the DeriveBytes. Метод Dispose
оставляет класс DeriveBytes в непригодном для использования состоянии.The Dispose
method leaves the DeriveBytes in an unusable state. После вызова метода Dispose
необходимо освободить все ссылки на объект DeriveBytes, чтобы сборщик мусора мог освободить память, занимаемую объектом DeriveBytes.After calling Dispose
, you must release all references to the DeriveBytes so the garbage collector can reclaim the memory that the DeriveBytes was occupying.
Дополнительные сведения см. в разделе Очистка неуправляемых ресурсов и Реализация метода Dispose.For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.
Примечание
Всегда вызывайте метод Dispose
перед освобождением последней ссылки на класс DeriveBytes.Always call Dispose
before you release your last reference to the DeriveBytes. В противном случае используемые им ресурсы не будут освобождены до тех пор, пока сборщик мусора не вызовет для объекта DeriveBytes метод Finalize
.Otherwise, the resources it is using will not be freed until the garbage collector calls the DeriveBytes object's Finalize
method.
Применяется к
Dispose(Boolean)
Если переопределено в производном классе, освобождает неуправляемые ресурсы, используемые классом DeriveBytes, и опционально освобождает управляемые ресурсы.When overridden in a derived class, releases the unmanaged resources used by the DeriveBytes class and optionally releases the managed resources.
protected:
virtual void Dispose(bool disposing);
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)
Параметры
- disposing
- Boolean
Значение true
позволяет освободить как управляемые, так и неуправляемые ресурсы; значение false
освобождает только неуправляемые ресурсы.true
to release both managed and unmanaged resources; false
to release only unmanaged resources.
Комментарии
Этот метод вызывается открытым Dispose()
методом и Finalize
методом.This method is called by the public Dispose()
method and the Finalize
method. Dispose()
вызывает защищенный Dispose(Boolean)
метод с disposing
параметром, для которого задано значение true
.Dispose()
invokes the protected Dispose(Boolean)
method with the disposing
parameter set to true
. Finalize
вызывает метод Dispose
с disposing
параметром, равным false
.Finalize
invokes Dispose
with disposing
set to false
.
Если параметр disposing
имеет значение true
, то данный метод освобождает все ресурсы, занятые любыми управляемыми объектами, на которые ссылается этот объект DeriveBytes.When the disposing
parameter is true
, this method releases all resources held by any managed objects that this DeriveBytes references. Этот метод вызывает метод Dispose()
каждого такого объекта.This method invokes the Dispose()
method of each referenced object.
Примечания для тех, кто наследует этот метод
Метод
Dispose
может вызываться несколько раз другими объектами.
Dispose
can be called multiple times by other objects. При переопределении Dispose(Boolean)
следует избегать ссылок на объекты, которые были удалены ранее при предыдущем вызове метода Dispose
.When overriding Dispose(Boolean)
, be careful not to reference objects that have been previously disposed in an earlier call to Dispose
. Дополнительные сведения о реализации см. в Dispose(Boolean)
разделе Реализация метода Dispose.For more information about how to implement Dispose(Boolean)
, see Implementing a Dispose Method.
Дополнительные сведения о Dispose
и Finalize
см. в разделе Очистка неуправляемых ресурсов.For more information about Dispose
and Finalize
, see Cleaning Up Unmanaged Resources.