Exemplo n.º 1
0
 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();
         }
     }
 }
Exemplo n.º 2
0
 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);
 }