Merge pull request #18728 from peppy/fix-unsafe-sample-playback

Fix unsafe sample playback in `GameplaySampleTriggerSource`
This commit is contained in:
Dan Balasescu 2022-06-17 12:26:46 +09:00 committed by GitHub
commit ea191da496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -56,12 +56,12 @@ public virtual void Play()
PlaySamples(samples); PlaySamples(samples);
} }
protected void PlaySamples(ISampleInfo[] samples) protected void PlaySamples(ISampleInfo[] samples) => Schedule(() =>
{ {
var hitSound = getNextSample(); var hitSound = getNextSample();
hitSound.Samples = samples; hitSound.Samples = samples;
hitSound.Play(); hitSound.Play();
} });
protected HitObject GetMostValidObject() protected HitObject GetMostValidObject()
{ {