Beispiel #1
0
        public static bool StopPluginWithTimeout(PluginInfo info)
        {
            // guarantee that the plugin will stop even if it behaves badly
            Timer timer = new Timer();
            timer.Interval = PluginStopTimeout;
            timer.Elapsed += delegate
            {
                StopTimeout(info);
            };
            timer.Start();

            try
            {
                info.controller.Stop();
                return true;
            }
            catch (Exception ex)
            {
                Log.Warning(ex);
                return false;
            }
            finally
            {
                info.domain = null;
            }
        }
Beispiel #2
0
 private static void StopTimeout(PluginInfo info)
 {
     Log.Debug("Timeout on domain " + info.domain.FriendlyName);
     AppDomain.Unload(info.domain);
 }