Improved dispose structure.
This commit is contained in:
@@ -96,7 +96,7 @@ namespace SlatedGameToolkit.Framework {
|
||||
timePassedFromLastRender = 0;
|
||||
}
|
||||
}
|
||||
manager.Dispose();
|
||||
manager.removeAllStates();
|
||||
stopped = true;
|
||||
SDL.SDL_Quit();
|
||||
logger.Information("Game engine has stopped.");
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes of this manager.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
removeAllStates();
|
||||
}
|
||||
|
||||
~Manager() {
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user