mirror of
https://github.com/ppy/osu.git
synced 2026-06-01 11:50:35 +08:00
More aggressively cancel debounced tracked bindable updates
If we've run an update since we can cancel the scheduled debounce run.
This commit is contained in:
@@ -82,8 +82,11 @@ namespace osu.Game.Beatmaps
|
||||
modSettingChangeTracker = new ModSettingChangeTracker(mods.NewValue);
|
||||
modSettingChangeTracker.SettingChanged += _ =>
|
||||
{
|
||||
debouncedModSettingsChange?.Cancel();
|
||||
debouncedModSettingsChange = Scheduler.AddDelayed(updateTrackedBindables, 100);
|
||||
lock (bindableUpdateLock)
|
||||
{
|
||||
debouncedModSettingsChange?.Cancel();
|
||||
debouncedModSettingsChange = Scheduler.AddDelayed(updateTrackedBindables, 100);
|
||||
}
|
||||
};
|
||||
}, true);
|
||||
}
|
||||
@@ -195,6 +198,9 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
lock (bindableUpdateLock)
|
||||
{
|
||||
debouncedModSettingsChange?.Cancel();
|
||||
debouncedModSettingsChange = null;
|
||||
|
||||
trackedUpdateCancellationSource.Cancel();
|
||||
trackedUpdateCancellationSource = new CancellationTokenSource();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user