mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 22:42:57 +08:00
Unbind ruleset event from leaderboard.
This commit is contained in:
parent
0b3f75505e
commit
ae9ce2f122
@ -22,6 +22,7 @@ using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Logging;
|
||||
using System.Net;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
@ -206,11 +207,21 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
this.osuGame = osuGame;
|
||||
|
||||
if (osuGame != null)
|
||||
osuGame.Ruleset.ValueChanged += r => updateScores();
|
||||
osuGame.Ruleset.ValueChanged += handleRulesetChange;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (osuGame != null)
|
||||
osuGame.Ruleset.ValueChanged -= handleRulesetChange;
|
||||
}
|
||||
|
||||
private GetScoresRequest getScoresRequest;
|
||||
|
||||
private void handleRulesetChange(RulesetInfo ruleset) => updateScores();
|
||||
|
||||
private void updateScores()
|
||||
{
|
||||
if (!IsLoaded) return;
|
||||
|
Loading…
Reference in New Issue
Block a user