Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/09 16:28:40 (15 years ago)
Author:
gkronber
Message:

Fixed #530 (Service applications are restarted again and again even when the user terminates the starter)

File:
1 edited

Legend:

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

    r877 r1392  
    3636
    3737    private ListViewItem pluginManagerListViewItem;
     38    private bool abortRequested;
    3839
    3940    public MainForm() {
     41      abortRequested = false;
    4042      SplashScreen splashScreen = new SplashScreen(1000, "Loading HeuristicLab...");
    4143      splashScreen.Owner = this;
     
    9799            do {
    98100              try {
    99                 PluginManager.Manager.Run(app);
     101                if(!abortRequested)
     102                  PluginManager.Manager.Run(app);
    100103                stopped = true;
    101104              } catch(Exception ex) {
     
    104107                Thread.Sleep(5000); // sleep 5 seconds before autorestart
    105108              }
    106             } while(!stopped && app.AutoRestart);
     109            } while(!abortRequested && !stopped && app.AutoRestart);
    107110          });
    108111          t.SetApartmentState(ApartmentState.STA); // needed for the AdvancedOptimizationFrontent
     
    148151      return sb.ToString();
    149152    }
     153
     154    private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
     155      abortRequested = true;
     156    }
    150157  }
    151158}
Note: See TracChangeset for help on using the changeset viewer.