From f2d52fbaa2656b1a334d32b8142b56ff44c5bbb1 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 27 Feb 2024 17:33:24 +0900 Subject: [PATCH] Make class not overrideable --- osu.Game/OsuGame.cs | 4 +--- osu.Game/Performance/HighPerformanceSessionManager.cs | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f23a78d2dc..13e80e0707 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -792,8 +792,6 @@ namespace osu.Game protected virtual UpdateManager CreateUpdateManager() => new UpdateManager(); - protected virtual HighPerformanceSessionManager CreateHighPerformanceSessionManager() => new HighPerformanceSessionManager(); - protected override Container CreateScalingContainer() => new ScalingContainer(ScalingMode.Everything); #region Beatmap progression @@ -1088,7 +1086,7 @@ namespace osu.Game loadComponentSingleFile(new AccountCreationOverlay(), topMostOverlayContent.Add, true); loadComponentSingleFile(new DialogOverlay(), topMostOverlayContent.Add, true); - loadComponentSingleFile(CreateHighPerformanceSessionManager(), Add, true); + loadComponentSingleFile(new HighPerformanceSessionManager(), Add, true); loadComponentSingleFile(new BackgroundDataStoreProcessor(), Add); diff --git a/osu.Game/Performance/HighPerformanceSessionManager.cs b/osu.Game/Performance/HighPerformanceSessionManager.cs index c5146933b7..22c929083c 100644 --- a/osu.Game/Performance/HighPerformanceSessionManager.cs +++ b/osu.Game/Performance/HighPerformanceSessionManager.cs @@ -14,11 +14,11 @@ namespace osu.Game.Performance public IDisposable BeginSession() { - EnableHighPerformanceSession(); - return new InvokeOnDisposal(this, static m => m.DisableHighPerformanceSession()); + enableHighPerformanceSession(); + return new InvokeOnDisposal(this, static m => m.disableHighPerformanceSession()); } - protected virtual void EnableHighPerformanceSession() + private void enableHighPerformanceSession() { originalGCMode = GCSettings.LatencyMode; GCSettings.LatencyMode = GCLatencyMode.LowLatency; @@ -27,7 +27,7 @@ namespace osu.Game.Performance GC.Collect(0); } - protected virtual void DisableHighPerformanceSession() + private void disableHighPerformanceSession() { if (GCSettings.LatencyMode == GCLatencyMode.LowLatency) GCSettings.LatencyMode = originalGCMode;