Skip to content

Commit

Permalink
Check IsDisposed first in SampleChannelBass Play
Browse files Browse the repository at this point in the history
  • Loading branch information
hwsmm committed Nov 29, 2024
1 parent 1f3afcf commit 630ea12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osu.Framework/Audio/Sample/SampleChannelBass.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using ManagedBass;
using osu.Framework.Audio.Mixing.Bass;
using osu.Framework.Audio.Track;
Expand Down Expand Up @@ -117,6 +118,9 @@ protected override void UpdateState()

public override void Play()
{
// Check if this channel is disposed first to not set enqueuedPlaybackStart to true, as it makes Playing true.
ObjectDisposedException.ThrowIf(IsDisposed, this);

userRequestedPlay = true;

// Pin Playing and IsAlive to true so that the channel isn't killed by the next update. This is only reset after playback is started.
Expand Down

0 comments on commit 630ea12

Please sign in to comment.