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; } }