Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/13/08 20:24:46 (16 years ago)
Author:
gkronber
Message:

added support for "service" applications that are restarted automatically when they crash with an exception. (related to #149)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab/MainForm.cs

    r241 r242  
    9494          PluginManager.Manager.Action += new PluginManagerActionEventHandler(splashScreen.Manager_Action);
    9595          Thread t = new Thread(delegate() {
    96             try {
    97               PluginManager.Manager.Run(app);
    98             } catch(Exception ex) {
    99               ShowErrorMessageBox(ex);
    100             }
     96            bool stopped = false;
     97            do {
     98              try {
     99                PluginManager.Manager.Run(app);
     100                stopped = true;
     101              } catch(Exception ex) {
     102                stopped = false;
     103                ThreadPool.QueueUserWorkItem(delegate(object exception) { ShowErrorMessageBox((Exception)exception); }, ex);
     104                Thread.Sleep(5000); // sleep 5 seconds before autorestart
     105              }
     106            } while(!stopped && app.AutoRestart);
    101107          });
    102108          t.SetApartmentState(ApartmentState.STA); // needed for the AdvancedOptimizationFrontent
Note: See TracChangeset for help on using the changeset viewer.