Skip to content

Commit

Permalink
fix: a memory leak appearing when some timeSeries.disabled === true
Browse files Browse the repository at this point in the history
Introduced in 86574e
  • Loading branch information
WofWca committed Sep 7, 2021
1 parent 84c1590 commit a6d7bc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions smoothie.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,18 +910,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 a6d7bc2

Please sign in to comment.