Skip to content

Commit

Permalink
Clear waveform cache on destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Sep 7, 2024
1 parent e00ad07 commit fedc1b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/waveform-zoomview.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,15 @@ WaveformZoomView.prototype.destroy = function() {
this._peaks.off('keyboard.shift_left', this._onKeyboardShiftLeft);
this._peaks.off('keyboard.shift_right', this._onKeyboardShiftRight);

if (this._enableWaveformCache) {
this._waveformData.clear();
delete this._waveformData;
delete this._waveformScales;
}
else {
delete this._data;
}

this._mouseDragHandler.destroy();

WaveformView.prototype.destroy.call(this);
Expand Down

0 comments on commit fedc1b2

Please sign in to comment.