mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 03:13:21 +08:00
Fix potential crash from cross-thread drawable mutation in collection management
As seen at https://github.com/peppy/osu/runs/4613800663?check_suite_focus=true.
This commit is contained in:
parent
e1b539fa9e
commit
d69552fbcf
@ -102,7 +102,6 @@ namespace osu.Game.Collections
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = Vector2.One,
|
||||
CornerRadius = item_height / 2,
|
||||
Current = collection.Name,
|
||||
PlaceholderText = IsCreated.Value ? string.Empty : "Create a new collection"
|
||||
},
|
||||
}
|
||||
@ -114,6 +113,9 @@ namespace osu.Game.Collections
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
// Bind late, as the collection name may change externally while still loading.
|
||||
textBox.Current = collection.Name;
|
||||
|
||||
collectionName.BindValueChanged(_ => createNewCollection(), true);
|
||||
IsCreated.BindValueChanged(created => textBoxPaddingContainer.Padding = new MarginPadding { Right = created.NewValue ? button_width : 0 }, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user