From 55ca3bd0a588e761f05ee6ebbcc759d9bd892e36 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 19 Sep 2020 02:44:46 +0100 Subject: [PATCH] I think we're supposed to unsub from events too. --- src/mixer/audio.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mixer/audio.ts b/src/mixer/audio.ts index df0615f..30986d0 100644 --- a/src/mixer/audio.ts +++ b/src/mixer/audio.ts @@ -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(); }