Skip to content

Commit fedc1b2

Browse files
committed
Clear waveform cache on destroy()
1 parent e00ad07 commit fedc1b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/waveform-zoomview.js

+9
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,15 @@ WaveformZoomView.prototype.destroy = function() {
601601
this._peaks.off('keyboard.shift_left', this._onKeyboardShiftLeft);
602602
this._peaks.off('keyboard.shift_right', this._onKeyboardShiftRight);
603603

604+
if (this._enableWaveformCache) {
605+
this._waveformData.clear();
606+
delete this._waveformData;
607+
delete this._waveformScales;
608+
}
609+
else {
610+
delete this._data;
611+
}
612+
604613
this._mouseDragHandler.destroy();
605614

606615
WaveformView.prototype.destroy.call(this);

0 commit comments

Comments
 (0)