Merge pull request #3276 from smoogipoo/fix-invalid-latencymode

Fix invalid GC latency mode being set
This commit is contained in:
Dean Herbert 2018-08-22 12:10:44 +09:00 committed by GitHub
commit 0d4dbee34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 2 deletions

View File

@ -13,15 +13,18 @@ public class GCSettings : SettingsSubsection
{
protected override string Header => "Garbage Collector";
private readonly Bindable<LatencyMode> latencyMode = new Bindable<LatencyMode>();
private Bindable<GCLatencyMode> configLatencyMode;
[BackgroundDependencyLoader]
private void load(FrameworkDebugConfigManager config)
{
Children = new Drawable[]
{
new SettingsEnumDropdown<GCLatencyMode>
new SettingsEnumDropdown<LatencyMode>
{
LabelText = "Active mode",
Bindable = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode)
Bindable = latencyMode
},
new SettingsButton
{
@ -29,6 +32,18 @@ private void load(FrameworkDebugConfigManager config)
Action = GC.Collect
},
};
configLatencyMode = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode);
configLatencyMode.BindValueChanged(v => latencyMode.Value = (LatencyMode)v, true);
latencyMode.BindValueChanged(v => configLatencyMode.Value = (GCLatencyMode)v);
}
private enum LatencyMode
{
Batch = GCLatencyMode.Batch,
Interactive = GCLatencyMode.Interactive,
LowLatency = GCLatencyMode.LowLatency,
SustainedLowLatency = GCLatencyMode.SustainedLowLatency
}
}
}