Resolve build errors

This commit is contained in:
Derrick Timmermans
2021-07-06 14:11:46 +02:00
parent 07d54d261a
commit ffe18ebe51
3 changed files with 27 additions and 20 deletions

View File

@ -69,7 +69,9 @@ namespace osu.Game.Graphics.Containers
{
// This event is used to update selection state when modified within the drawable itself.
// It is added to a dictionary so that we can unsubscribe if the drawable is removed from this container
drawable.StateChanged += handlerMap[drawable] = state => selectionChanged(drawable, state);
handlerMap[drawable] = state => selectionChanged(drawable, state);
drawable.StateChanged += handlerMap[drawable];
base.Add(drawable);
}
@ -79,8 +81,12 @@ namespace osu.Game.Graphics.Containers
if (!base.Remove(drawable))
return false;
drawable.StateChanged -= handlerMap[drawable];
handlerMap.Remove(drawable);
if (handlerMap.TryGetValue(drawable, out var action))
{
drawable.StateChanged -= action;
handlerMap.Remove(drawable);
}
return true;
}