diff --git a/src/org/ice4j/ice/harvest/CandidateHarvester.java b/src/org/ice4j/ice/harvest/CandidateHarvester.java index 9fc02d3..1c3adab 100644 --- a/src/org/ice4j/ice/harvest/CandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/CandidateHarvester.java @@ -73,6 +73,17 @@ public abstract class CandidateHarvester this.lastStartHarvestingTime = -1; } + /** + * Disabless the harvesting timer. Called when the harvest is disabled. + */ + public void disableHarvesting() + { + // Remember the last harvesting time. + this.lastHarvestingTime = -1; + // Stops the current timer. + this.lastStartHarvestingTime = -1; + } + /** * Returns the current harvesting time in ms. If this harvester is not * currently harvesting, then returns the value of the last harvesting time. diff --git a/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java b/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java index 20ae4ba..c9756c2 100644 --- a/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java +++ b/src/org/ice4j/ice/harvest/CandidateHarvesterSet.java @@ -469,6 +469,7 @@ public class CandidateHarvesterSet public void setEnabled(boolean enabled) { logger.info("disabling harvester: " + harvester); + harvester.disableHarvesting(); this.enabled = enabled; } }