Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17646 for trunk


Ignore:
Timestamp:
07/03/20 16:59:16 (4 years ago)
Author:
gkronber
Message:

#3078 added synchronization in RegressionInstanceProviderView which solves the crashes on my machine.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r17426 r17646  
    179179
    180180    private void UpdateProgressValue() {
     181      if (Disposing || IsDisposed) return;
    181182      if (InvokeRequired) {
    182183        Invoke((Action)UpdateProgressValue);
  • trunk/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceProviderView.cs

    r17180 r17646  
    4949          var content = activeView.Content;
    5050          // lock active view and show progress bar
     51          IProgress progress = null;
    5152          try {
    52             var progress = Progress.Show(content, "Loading problem instance.");
     53            progress = Progress.Show(content, "Loading problem instance.");
    5354
    54             Content.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
     55            Content.ProgressChanged += (o, args) => {
     56              lock (progress) {
     57                if (progress.ProgressState == ProgressState.Started)
     58                  progress.ProgressValue = args.ProgressPercentage / 100.0;
     59              }
     60            };
    5561
    5662            instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
     
    5965            return;
    6066          } finally {
    61             Progress.Hide(content);
     67            lock (progress) {
     68              Progress.Hide(content);
     69            }
    6270          }
    6371
Note: See TracChangeset for help on using the changeset viewer.