I think we're supposed to unsub from events too.

This commit is contained in:
Matthew Stratford 2020-09-19 02:44:46 +01:00
parent 044eaec509
commit 55ca3bd0a5

View file

@ -151,6 +151,8 @@ class Player extends ((PlayerEmitter as unknown) as { new (): EventEmitter }) {
}
cleanup() {
// Unsubscribe from events.
this.wavesurfer.unAll();
// Let wavesurfer remove the old media, otherwise ram leak!
this.wavesurfer.destroy();
}