From e4a00155c761168122c73ec9de63704440f7e27b Mon Sep 17 00:00:00 2001 From: arthurkehrwald <50906979+arthurkehrwald@users.noreply.github.com> Date: Sun, 30 Mar 2025 14:43:13 +0200 Subject: [PATCH] Dispose disposable sound event sources --- .../VisualPinball.Unity/Sound/EventSoundComponent.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/VisualPinball.Unity/VisualPinball.Unity/Sound/EventSoundComponent.cs b/VisualPinball.Unity/VisualPinball.Unity/Sound/EventSoundComponent.cs index b22797ef4..dd54626b6 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/Sound/EventSoundComponent.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/Sound/EventSoundComponent.cs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +using System; + namespace VisualPinball.Unity { /// @@ -54,6 +56,7 @@ protected override void OnDisable() if (_eventSource != null) { Unsubscribe(_eventSource); + (_eventSource as IDisposable)?.Dispose(); _eventSource = null; } }