karaoke-dev / karaoke

Will be the best karaoke system.
http://blog.karaoke.dev
GNU General Public License v3.0
208 stars 16 forks source link

Fix have random crash in the editor in release build. #1204

Open andy840119 opened 2 years ago

andy840119 commented 2 years ago

Will have the random crashes in the karaoke editor when switching to edit mode or switch to another tab.

Here's the error:

2022-03-19 02:49:10 [error]: An unhandled error has occurred.
2022-03-19 02:49:10 [error]: osu.Framework.Graphics.Drawable+InvalidThreadForMutationException: Cannot mutate the InternalChildren on a Loaded Drawable while not on the update thread. Consider using Schedule to schedule the mutation operation.
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Drawable.EnsureMutationAllowed(String action)
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.ChangeInternalChildDepth(Drawable child, Single newDepth)
2022-03-19 02:49:10 [error]: at osu.Game.Screens.Edit.Compose.Components.EditorBlueprintContainer.OnBlueprintDeselected(SelectionBlueprint`1 blueprint)
2022-03-19 02:49:10 [error]: at osu.Game.Screens.Edit.Compose.Components.BlueprintContainer`1.<load>b__23_0(Object selectedObjects, NotifyCollectionChangedEventArgs args)
2022-03-19 02:49:10 [error]: at osu.Framework.Bindables.BindableList`1.removeAll(Predicate`1 match, BindableList`1 caller)
2022-03-19 02:49:10 [error]: at osu.Framework.Bindables.BindableList`1.removeAll(Predicate`1 match, BindableList`1 caller)
2022-03-19 02:49:10 [error]: at osu.Game.Rulesets.Karaoke.Utils.BindablesUtils.<>c__DisplayClass1_0`2.<OnyWaySync>b__0(Object _, NotifyCollectionChangedEventArgs args)
2022-03-19 02:49:10 [error]: at osu.Framework.Bindables.BindableList`1.clear(BindableList`1 caller)
2022-03-19 02:49:10 [error]: at osu.Game.Rulesets.Karaoke.Edit.Singers.SingerScreen.PopOut()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.VisibilityContainer.LoadAsyncComplete()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Drawable.load(IFrameBasedClock clock, IReadOnlyDependencyContainer dependencies)
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Drawable.Load(IFrameBasedClock clock, IReadOnlyDependencyContainer dependencies, Boolean isDirectAsyncContext)
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Drawable.LoadFromAsync(IFrameBasedClock clock, IReadOnlyDependencyContainer dependencies, Boolean isDirectAsyncContext)
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.loadComponents[TLoadable](List`1 components, IReadOnlyDependencyContainer dependencies, Boolean isDirectAsyncContext, CancellationToken cancellation)
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.<>c__DisplayClass17_0`1.<LoadComponentsAsync>b__1()
2022-03-19 02:49:10 [error]: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
2022-03-19 02:49:10 [error]: --- End of stack trace from previous location ---
2022-03-19 02:49:10 [error]: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
2022-03-19 02:49:10 [error]: --- End of stack trace from previous location ---
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.<>c__DisplayClass17_2`1.<LoadComponentsAsync>b__4()
2022-03-19 02:49:10 [error]: at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
2022-03-19 02:49:10 [error]: at osu.Framework.Threading.Scheduler.Update()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Drawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
2022-03-19 02:49:10 [error]: at osu.Framework.Platform.GameHost.UpdateFrame()
2022-03-19 02:49:10 [error]: at osu.Framework.Threading.GameThread.processFrame()
andy840119 commented 2 years ago

Go no idea why it's related to EditorBlueprintContainer.OnBlueprintDeselected again. Maybe related to #1202

andy840119 commented 2 years ago

Not really sure matched to the https://github.com/ppy/osu/pull/20270/files ?