From 041e3bf823cf17e6edf6475645fdb1a5f94abf81 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 Jan 2019 19:08:54 +0900 Subject: [PATCH] Handle unbinding better --- osu.Game/Overlays/Direct/DownloadTrackingComposite.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs b/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs index 733bcf877e..fddbefdf4d 100644 --- a/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs +++ b/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs @@ -58,8 +58,13 @@ namespace osu.Game.Overlays.Direct protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); + beatmaps.BeatmapDownloadBegan -= attachDownload; beatmaps.ItemAdded -= setAdded; + + State.UnbindAll(); + + attachDownload(null); } #endregion @@ -103,7 +108,6 @@ namespace osu.Game.Overlays.Direct private void onRequestSuccess(string data) { Schedule(() => State.Value = DownloadState.Downloaded); - attachDownload(null); } private void onRequestProgress(float progress) @@ -113,7 +117,7 @@ namespace osu.Game.Overlays.Direct private void onRequestFailure(Exception e) { - Schedule(() => State.Value = DownloadState.NotDownloaded); + Schedule(() => attachDownload(null)); } private void setAdded(BeatmapSetInfo s, bool existing, bool silent)