public static void Close() { if (_theRuntime.InitiateShutdownOnce()) { //Close is called SetShutdownReason(ApplicationShutdownReason.FluorineRuntimeClose, "FluorineRuntime.Close is called"); if (HostingEnvironment.IsHosted) { HostingEnvironment.InitiateShutdown(); } else { _theRuntime.Dispose(); } } }
internal static bool ShutdownAppDomain() { if (!HostingEnvironment.ShutdownInitiated) { HostingEnvironment.InitiateShutdown(); return(true); } if (HostingEnvironment.ShutdownInProgress) { return(false); } if (!_theRuntime.InitiateShutdownOnce()) { return(false); } OnAppDomainShutdown(new HostUnloadEventArgs(_theRuntime._shutdownReason)); ThreadPool.QueueUserWorkItem(_theRuntime._appDomainUnloadallback); return(true); }