DeriveBytes.Dispose Método

Definição

Quando substituído em uma classe derivada, libera todos os recursos usados pela instância atual da classe DeriveBytes.When overridden in a derived class, releases all resources used by the current instance of the DeriveBytes class.

Sobrecargas

Dispose()

Quando substituído em uma classe derivada, libera todos os recursos usados pela instância atual da classe DeriveBytes.When overridden in a derived class, releases all resources used by the current instance of the DeriveBytes class.

Dispose(Boolean)

Quando substituído em uma classe derivada, libera os recursos não gerenciados usados pela classe DeriveBytes e, opcionalmente, libera os recursos gerenciados.When overridden in a derived class, releases the unmanaged resources used by the DeriveBytes class and optionally releases the managed resources.

Dispose()

Quando substituído em uma classe derivada, libera todos os recursos usados pela instância atual da classe 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 ()

Implementações

Comentários

Chame Dispose quando terminar de usar o DeriveBytes .Call Dispose when you are finished using the DeriveBytes. O Dispose método deixa o DeriveBytes em um estado inutilizável.The Dispose method leaves the DeriveBytes in an unusable state. Depois Dispose de chamar, você deve liberar todas as referências para o DeriveBytes , para que o coletor de lixo possa recuperar a memória que DeriveBytes estava ocupando.After calling Dispose, you must release all references to the DeriveBytes so the garbage collector can reclaim the memory that the DeriveBytes was occupying.

Para obter mais informações, consulte limpando recursos não gerenciados e implementando um método Dispose.For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Observação

Sempre chame Dispose antes de liberar sua última referência para o DeriveBytes .Always call Dispose before you release your last reference to the DeriveBytes. Caso contrário, os recursos que ele está usando não serão liberados até que o coletor de lixo chame o DeriveBytes método do objeto Finalize .Otherwise, the resources it is using will not be freed until the garbage collector calls the DeriveBytes object's Finalize method.

Aplica-se a

Dispose(Boolean)

Quando substituído em uma classe derivada, libera os recursos não gerenciados usados pela classe DeriveBytes e, opcionalmente, libera os recursos gerenciados.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)

Parâmetros

disposing
Boolean

true para liberar recursos gerenciados e não gerenciados; false para liberar apenas recursos não gerenciados.true to release both managed and unmanaged resources; false to release only unmanaged resources.

Comentários

Este método é chamado pelo método público Dispose() e pelo método Finalize.This method is called by the public Dispose() method and the Finalize method. Dispose() invoca o método Dispose(Boolean) protegido com o parâmetro disposing definido como true.Dispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invoca Dispose com disposing definido como false.Finalize invokes Dispose with disposing set to false.

Quando o disposing parâmetro é true , esse método libera todos os recursos mantidos por qualquer objeto gerenciado que DeriveBytes faça referência a ele.When the disposing parameter is true, this method releases all resources held by any managed objects that this DeriveBytes references. Este método invoca o método Dispose() de cada objeto referenciado.This method invokes the Dispose() method of each referenced object.

Notas aos Herdeiros

Dispose pode ser chamado várias vezes por outros objetos. Dispose can be called multiple times by other objects. Ao substituir Dispose(Boolean) , tenha cuidado para não fazer referência a objetos que foram previamente descartados em uma chamada anterior ao Dispose .When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed in an earlier call to Dispose. Para obter mais informações sobre como implementar Dispose(Boolean) o, consulte [implementando um método Dispose](/dotnet/standard/garbage-collection/implementing-dispose).For more information about how to implement Dispose(Boolean), see [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).

Para obter mais informações sobre o Dispose e o Finalize , consulte limpando recursos não gerenciados.For more information about Dispose and Finalize, see Cleaning Up Unmanaged Resources.

Aplica-se a