Skip to content

Commit

Permalink
Simulation Experiment view: fixed a small issue with the tracking of …
Browse files Browse the repository at this point in the history
…the end of a simulation.

If we were to run several simulations at the same time, we might have ended up with one of them having its progress updated *after* the simulation finished.
  • Loading branch information
agarny committed Nov 19, 2019
1 parent 7056eaf commit af84fb6
Showing 1 changed file with 2 additions and 10 deletions.
Expand Up @@ -897,7 +897,7 @@ void SimulationExperimentViewSimulationWidget::initialize(bool pReloadingView)

// Reset our progress

mProgress = -1;
mProgress = 0;

// Clean up our output, if needed

Expand Down Expand Up @@ -3568,14 +3568,6 @@ void SimulationExperimentViewSimulationWidget::simulationDone(qint64 pElapsedTim
// Stop keeping track of our simulation progress

mProgress = -1;

// Note: our simulation progress gets reset in resetSimulationProgress(),
// which is called by
// SimulationExperimentViewWidget::checkSimulationResults(). To reset
// our simulation progress here might not always work since our
// simulation is run in a different thread, meaning that a call to
// updateSimulationResults() might occur after we have reset our
// simulation progress...
}

//==============================================================================
Expand Down Expand Up @@ -4316,7 +4308,7 @@ void SimulationExperimentViewSimulationWidget::updateSimulationResults(Simulatio
// Note: tabBarPixmapSize()-2 because we want a one-pixel wide
// border...

if (newProgress != mProgress) {
if ((newProgress != mProgress) && (mProgress != -1)) {
// The progress has changed, so keep track of its new value and
// update our file tab icon

Expand Down

0 comments on commit af84fb6

Please sign in to comment.