LogRecord.Dispose Method


Releases all resources used by the LogRecord.

 abstract void Dispose();
public abstract void Dispose ();
abstract member Dispose : unit -> unit
Public MustOverride Sub Dispose ()



You should call this method when you finish using the LogRecord instance. The Dispose method leaves the LogRecord instance in an unusable state. After calling this method, you must release all references to the LogRecord instance, so that the garbage collector can reclaim the memory that the LogRecord instance was occupying.


Always call Dispose before you release your last reference to the LogRecord instance. Otherwise, the resources it is using cannot be freed until the garbage collector calls the LogRecord instance's Finalize method.

Applies to