Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/03/18 07:16:03 (7 years ago)
Author:
jkarder
Message:

#2822: merged r15408:15409, r15452 and r15560 into stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimization

  • stable/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs

    r15384 r15573  
    2121
    2222using System;
    23 using System.Linq;
    2423using System.Threading;
    2524using HeuristicLab.Common;
     
    8079      try {
    8180        Run((object)cancellationTokenSource.Token);
    82       }
    83       catch (OperationCanceledException) {
    84       }
    85       catch (AggregateException ae) {
     81      } catch (OperationCanceledException) {
     82      } catch (AggregateException ae) {
    8683        ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e));
    87       }
    88       catch (Exception e) {
     84      } catch (Exception e) {
    8985        OnExceptionOccurred(e);
    9086      }
     
    104100      base.Pause();
    105101      pausePending = true;
    106       CancellationTokenSource.Cancel();
     102      if (CancellationTokenSource != null) CancellationTokenSource.Cancel();
    107103    }
    108104
     
    112108      base.Stop();
    113109      if (ExecutionState == ExecutionState.Paused) OnStopped();
    114       else CancellationTokenSource.Cancel();
     110      else if (CancellationTokenSource != null) CancellationTokenSource.Cancel();
    115111    }
    116112
     
    127123        initialized = true;
    128124        Run(cancellationToken);
    129       }
    130       finally {
     125      } finally {
    131126        timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
    132127        timer.Stop();
Note: See TracChangeset for help on using the changeset viewer.