Changeset 15573 for stable/HeuristicLab.Optimization/3.3/Algorithms
- Timestamp:
- 01/03/18 07:16:03 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 15408-15409,15452,15560
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/branches/ParallelExperiment/HeuristicLab.Optimization (added) merged: 15337,15373,15375,15389,15394,15407 /trunk/sources/HeuristicLab.Optimization merged: 15408-15409,15452,15560
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r15384 r15573 21 21 22 22 using System; 23 using System.Linq;24 23 using System.Threading; 25 24 using HeuristicLab.Common; … … 80 79 try { 81 80 Run((object)cancellationTokenSource.Token); 82 } 83 catch (OperationCanceledException) { 84 } 85 catch (AggregateException ae) { 81 } catch (OperationCanceledException) { 82 } catch (AggregateException ae) { 86 83 ae.FlattenAndHandle(new[] { typeof(OperationCanceledException) }, e => OnExceptionOccurred(e)); 87 } 88 catch (Exception e) { 84 } catch (Exception e) { 89 85 OnExceptionOccurred(e); 90 86 } … … 104 100 base.Pause(); 105 101 pausePending = true; 106 CancellationTokenSource.Cancel();102 if (CancellationTokenSource != null) CancellationTokenSource.Cancel(); 107 103 } 108 104 … … 112 108 base.Stop(); 113 109 if (ExecutionState == ExecutionState.Paused) OnStopped(); 114 else CancellationTokenSource.Cancel();110 else if (CancellationTokenSource != null) CancellationTokenSource.Cancel(); 115 111 } 116 112 … … 127 123 initialized = true; 128 124 Run(cancellationToken); 129 } 130 finally { 125 } finally { 131 126 timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); 132 127 timer.Stop();
Note: See TracChangeset
for help on using the changeset viewer.