Skip to content

Commit

Permalink
chore: adjust stop method to throw exception if invoked while disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinWilkinson committed Apr 9, 2024
1 parent b99de2b commit b93eb0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Velaptor/Content/Audio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ public void SetTimePosition(float seconds)
/// <inheritdoc cref="IAudio"/>
public void Stop()
{
// TODO: This is a temporary fix until the next bug release of CASL is done.
if (this.isDisposed || this.caslAudio.State == AudioState.Stopped)
if (this.isDisposed)
{
return;
throw new ObjectDisposedException("Audio is disposed.");
}

this.caslAudio.Reset();
Expand Down

0 comments on commit b93eb0d

Please sign in to comment.