Skip to content

Commit

Permalink
fix(Notification::Sound): Fix crash when playing a custom sound.
Browse files Browse the repository at this point in the history
Fixes #790
Fixes SOUNDSWITCH-BT
  • Loading branch information
Belphemur committed Oct 13, 2021
1 parent 8e56842 commit f0a7113
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SoundSwitch/Framework/Audio/Play/PlaySoundJob.cs
Expand Up @@ -44,7 +44,15 @@ public async Task ExecuteAsync(CancellationToken cancellationToken)

void PlayerOnPlaybackStopped(object o, StoppedEventArgs stoppedEventArgs)
{
semaphore.Release();
try
{
semaphore.Release();
}
catch (ObjectDisposedException)
{
//Ignored
//Already disposed, no need to release anything
}
}

player.PlaybackStopped += PlayerOnPlaybackStopped;
Expand Down

0 comments on commit f0a7113

Please sign in to comment.