mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:17:23 +08:00
Fix memory leak from Player's InputManager.
This commit is contained in:
parent
65a24dfe5d
commit
5096f6b83d
@ -222,6 +222,12 @@ namespace osu.Game.Screens.Play
|
||||
if (IsPaused) Pause(); else Resume();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
playerInputManager?.Dispose();
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
{
|
||||
sourceClock.Stop(); // If the clock is running and Restart is called the game will lag until relaunch
|
||||
@ -312,6 +318,9 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
else
|
||||
{
|
||||
FadeOut(250);
|
||||
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
||||
|
||||
dimLevel.ValueChanged -= dimChanged;
|
||||
Background?.FadeTo(1f, 200);
|
||||
return base.OnExiting(next);
|
||||
|
@ -89,6 +89,12 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
|
||||
FadeOut(150);
|
||||
|
||||
//this is required to clean up the InputManager in Player.
|
||||
//can be removed once we solve that one.
|
||||
if (player != null && player.LoadState != LoadState.Alive)
|
||||
player.Dispose();
|
||||
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user