From 442d357626fb38f98013d7309975de01ce312b95 Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 27 May 2020 00:33:26 -0500 Subject: [PATCH] Improved dispose structure. --- src/SlatedGameToolkit.Framework/GameEngine.cs | 2 +- .../StateSystem/Manager.cs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/SlatedGameToolkit.Framework/GameEngine.cs b/src/SlatedGameToolkit.Framework/GameEngine.cs index 7fbe809..14cf610 100644 --- a/src/SlatedGameToolkit.Framework/GameEngine.cs +++ b/src/SlatedGameToolkit.Framework/GameEngine.cs @@ -96,7 +96,7 @@ namespace SlatedGameToolkit.Framework { timePassedFromLastRender = 0; } } - manager.Dispose(); + manager.removeAllStates(); stopped = true; SDL.SDL_Quit(); logger.Information("Game engine has stopped."); diff --git a/src/SlatedGameToolkit.Framework/StateSystem/Manager.cs b/src/SlatedGameToolkit.Framework/StateSystem/Manager.cs index 0bcff20..d4014c9 100644 --- a/src/SlatedGameToolkit.Framework/StateSystem/Manager.cs +++ b/src/SlatedGameToolkit.Framework/StateSystem/Manager.cs @@ -5,7 +5,7 @@ using SlatedGameToolkit.Framework.StateSystem.States; namespace SlatedGameToolkit.Framework.StateSystem { - public sealed class Manager : IDisposable { + public sealed class Manager { public Thread thread; private IState currentState; private IState nextState; @@ -114,17 +114,5 @@ namespace SlatedGameToolkit.Framework.StateSystem removeState(state); } } - - /// - /// Disposes of this manager. - /// - public void Dispose() - { - removeAllStates(); - } - - ~Manager() { - Dispose(); - } } } \ No newline at end of file