I think we're supposed to unsub from events too.
This commit is contained in:
parent
044eaec509
commit
55ca3bd0a5
1 changed files with 2 additions and 0 deletions
|
@ -151,6 +151,8 @@ class Player extends ((PlayerEmitter as unknown) as { new (): EventEmitter }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
// Unsubscribe from events.
|
||||||
|
this.wavesurfer.unAll();
|
||||||
// Let wavesurfer remove the old media, otherwise ram leak!
|
// Let wavesurfer remove the old media, otherwise ram leak!
|
||||||
this.wavesurfer.destroy();
|
this.wavesurfer.destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue