ApplicationContext.Finalize ApplicationContext.Finalize ApplicationContext.Finalize ApplicationContext.Finalize Method

定义

尝试在应用程序上下文被垃圾回收前释放资源并执行其他清理操作。Attempts to free resources and perform other cleanup operations before the application context is reclaimed by garbage collection.

!ApplicationContext ()
~ApplicationContext ();
override this.Finalize : unit -> unit
Finalize ()

注解

此方法通过Object.Finalize调用Dispose(false)重写并清理资源。This method overrides Object.Finalize and cleans up resources by calling Dispose(false). 重写 Dispose(Boolean) 以自定义清理。Override Dispose(Boolean) to customize the cleanup.

应用程序代码不应调用此方法;在垃圾回收Finalize过程中会自动调用对象的方法,除非已通过调用GC.SuppressFinalize方法禁用了垃圾回收器终止。Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the GC.SuppressFinalize method.

有关详细信息,请参阅Finalize 方法和析构函数清理非托管资源重写 Finalize 方法For more information, see Finalize Methods and Destructors, Cleaning Up Unmanaged Resources, and Overriding the Finalize Method.

适用于