mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Fix some web requests being run after disposal of their owner
This commit is contained in:
@ -16,6 +16,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
private readonly bool includeWeight;
|
||||
private readonly ScoreType type;
|
||||
private GetUserScoresRequest request;
|
||||
|
||||
public PaginatedScoreContainer(ScoreType type, Bindable<User> user, string header, string missing, bool includeWeight = false)
|
||||
: base(user, header, missing)
|
||||
@ -32,9 +33,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
base.ShowMore();
|
||||
|
||||
var req = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
|
||||
|
||||
req.Success += scores =>
|
||||
request = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage);
|
||||
request.Success += scores => Schedule(() =>
|
||||
{
|
||||
foreach (var s in scores)
|
||||
s.ApplyRuleset(Rulesets.GetRuleset(s.OnlineRulesetID));
|
||||
@ -66,9 +66,15 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
|
||||
ItemsContainer.Add(drawableScore);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Api.Queue(req);
|
||||
Api.Queue(request);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
request?.Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user