Changeset 15337 for branches/ParallelExperiment/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
- Timestamp:
- 08/22/17 14:08:52 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParallelExperiment/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
r15302 r15337 80 80 try { 81 81 Run((object)cancellationTokenSource.Token); 82 } 83 catch (OperationCanceledException) { 84 } 85 catch (AggregateException ae) { 82 } catch (OperationCanceledException) { 83 } catch (AggregateException ae) { 86 84 OnExceptionOccurred(ae.InnerExceptions.SingleOrDefault() ?? ae); 87 } 88 catch (Exception e) { 85 } catch (Exception e) { 89 86 OnExceptionOccurred(e); 90 87 } … … 104 101 base.Pause(); 105 102 pausePending = true; 106 CancellationTokenSource .Cancel();103 CancellationTokenSource?.Cancel(); 107 104 } 108 105 … … 112 109 base.Stop(); 113 110 if (ExecutionState == ExecutionState.Paused) OnStopped(); 114 else CancellationTokenSource .Cancel();111 else CancellationTokenSource?.Cancel(); 115 112 } 116 113 … … 127 124 initialized = true; 128 125 Run(cancellationToken); 129 } 130 finally { 126 } finally { 131 127 timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed); 132 128 timer.Stop();
Note: See TracChangeset
for help on using the changeset viewer.