Skip to content

Commit 630ea12

Browse files
committed
Check IsDisposed first in SampleChannelBass Play
1 parent 1f3afcf commit 630ea12

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

osu.Framework/Audio/Sample/SampleChannelBass.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4+
using System;
45
using ManagedBass;
56
using osu.Framework.Audio.Mixing.Bass;
67
using osu.Framework.Audio.Track;
@@ -117,6 +118,9 @@ protected override void UpdateState()
117118

118119
public override void Play()
119120
{
121+
// Check if this channel is disposed first to not set enqueuedPlaybackStart to true, as it makes Playing true.
122+
ObjectDisposedException.ThrowIf(IsDisposed, this);
123+
120124
userRequestedPlay = true;
121125

122126
// 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.

0 commit comments

Comments
 (0)