Disallow transferring track from test `WorkingBeatmap`s which have local stores

This commit is contained in:
Salman Ahmed 2022-05-20 14:43:50 +03:00
parent c78d90ccbd
commit cef99fd020
2 changed files with 14 additions and 0 deletions

View File

@ -59,6 +59,13 @@ public WaveformTestBeatmap(AudioManager audioManager, Beatmap beatmap)
protected override Track GetBeatmapTrack() => trackStore.Get(firstAudioFile);
public override bool TryTransferTrack(WorkingBeatmap target)
{
// Our track comes from a local track store that's disposed on finalizer,
// therefore it's unsafe to transfer it to another working beatmap.
return false;
}
private string firstAudioFile
{
get

View File

@ -373,6 +373,13 @@ public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IF
protected override Track GetBeatmapTrack() => track;
public override bool TryTransferTrack(WorkingBeatmap target)
{
// Our track comes from a local track store that's disposed on finalizer,
// therefore it's unsafe to transfer it to another working beatmap.
return false;
}
public class TrackVirtualStore : AudioCollectionManager<Track>, ITrackStore
{
private readonly IFrameBasedClock referenceClock;