mirror of
https://github.com/osukey/osukey.git
synced 2025-05-22 22:17:36 +09: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();
|
if (IsPaused) Pause(); else Resume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
playerInputManager?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public void Restart()
|
public void Restart()
|
||||||
{
|
{
|
||||||
sourceClock.Stop(); // If the clock is running and Restart is called the game will lag until relaunch
|
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
|
else
|
||||||
{
|
{
|
||||||
|
FadeOut(250);
|
||||||
|
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
||||||
|
|
||||||
dimLevel.ValueChanged -= dimChanged;
|
dimLevel.ValueChanged -= dimChanged;
|
||||||
Background?.FadeTo(1f, 200);
|
Background?.FadeTo(1f, 200);
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
|
@ -89,6 +89,12 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
|
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
|
||||||
FadeOut(150);
|
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);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user