From 32210f34b186b44cc9c0484d7f67641162b325f6 Mon Sep 17 00:00:00 2001 From: krida2000 <71345244+krida2000@users.noreply.github.com> Date: Tue, 23 May 2023 15:39:40 +0300 Subject: [PATCH] fix: `AudioElement` is not getting released correctly (#1516) # Description Implement correct `AudioElement` releasing as mentioned in the #966 --- packages/audioplayers_web/lib/wrapped_player.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/audioplayers_web/lib/wrapped_player.dart b/packages/audioplayers_web/lib/wrapped_player.dart index 7ed642f60..dc91edfc1 100644 --- a/packages/audioplayers_web/lib/wrapped_player.dart +++ b/packages/audioplayers_web/lib/wrapped_player.dart @@ -161,6 +161,9 @@ class WrappedPlayer { } void release() { + // Release `AudioElement` correctly (#966) + player?.src = ''; + player?.remove(); _cancel(); player = null; _stereoPanner = null;