Skip to content

Commit

Permalink
Merge branch 'fix-memory-leak' into recent-mrs
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Oct 17, 2021
2 parents c25368c + 85cb245 commit e19b7d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions smoothie.js
Expand Up @@ -96,6 +96,7 @@
* Fix data drop stoppage by rejecting NaNs in append(), by @timdrysdale
* Allow setting interpolation per time series, by @WofWca (#123)
* Fix chart constantly jumping in 1-2 pixel steps, by @WofWca (#131)
* Fix a memory leak appearing when some `timeSeries.disabled === true`, by @WofWca (#132)
*/

;(function(exports) {
Expand Down Expand Up @@ -911,18 +912,18 @@

// For each data set...
for (var d = 0; d < this.seriesSet.length; d++) {
context.save();
var timeSeries = this.seriesSet[d].timeSeries;

// Delete old data that's moved off the left of the chart.
timeSeries.dropOldData(oldestValidTime, chartOptions.maxDataSetLength);
if (timeSeries.disabled) {
continue;
}
context.save();

var dataSet = timeSeries.data,
seriesOptions = this.seriesSet[d].options;

// Delete old data that's moved off the left of the chart.
timeSeries.dropOldData(oldestValidTime, chartOptions.maxDataSetLength);

// Set style for this dataSet.
context.lineWidth = seriesOptions.lineWidth;
context.strokeStyle = seriesOptions.strokeStyle;
Expand Down

0 comments on commit e19b7d6

Please sign in to comment.