You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First, thanks for writting this amazing library. I love it. 💖
Secondly, I am using this library in my game developed using a custom game engine.
The bindings work fine but I found this special case when it crashes with a fatal AccessViolationException.
The code in question is something like this:
publicclassBuildModeFurniturePreviewNode:ObservableObject,IBuildModeTab,IDisposable{privatereadonlyBuildModeActivityViewModel_parent;privatereadonlyEBinding_bindings;publicBuildModeFurniturePreviewNode(BuildModeActivityViewModelparent){this._parent =vm;// More stuff here...this._bindings =new EBinding
{()=>this.CursorWorldPosition ==this._parent.CursorWorldPosition,};}publicvoidDispose(){this._bindings.Dispose();}// More stuff here...}publicclassBuildModeActivityViewModel:ObservableObject{privatereadonlyList<IBuildModeTab>_tabs=new();publicIReadOnlyList<IBuildModeTab> Tabs =>this._tabs;publicBuildModeActivityViewModel(){this.ChangeTabCommand =newRelayCommand<IBuildModeTab>(tab =>this.CurrentTab =tab!,(tab)=>this.CurrentTab !=tab);this._tabs.AddRange(new IBuildModeTab[]{new FurnitureTabViewModel(this),// More tabs here...//new FloorsTabViewModel(this),//new WallsTabViewModel(this),//new RoofsTabViewModel(this),});this._currentTab =this._tabs[0];}privateIBuildModeTab_currentTab;publicIBuildModeTabCurrentTab{get=>this._currentTab;set=>this.SetProperty(refthis._currentTab, value);}// More stuff here...}
I this the problem is when I try to bind to properties of a parent object that hasn't finished to run it's constructor code.
Here is the stack trace:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Runtime.CompilerServices.CastHelpers.ChkCastInterface(Void*, System.Object)
at EBind.TriggerDelegate+<>c.<.ctor>b__1_1(System.Object, System.Object)
at EBind.ExpressionBinding.Subscribe(System.Collections.Generic.IEnumerable`1<EBind.Trigger>, System.Action)
at EBind.EqualityBindings.EqualityBinding`1[[System.Nullable`1[[System.Numerics.Vector2, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(System.Linq.Expressions.Expression, System.Linq.Expressions.Expression, EBind.BindFlag, EBind.Configuration)
at EBind.EqualityBindings.EqualityBindingFactory`1[[System.Nullable`1[[System.Numerics.Vector2, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Create(System.Linq.Expressions.Expression, System.Linq.Expressions.Expression, EBind.BindFlag, EBind.Configuration)
at EBind.EqualityBindings.EqualityBinding.Create[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Linq.Expressions.Expression`1<System.Func`1<Boolean>>, EBind.BindFlag, EBind.Configuration)
at EBind.ExpressionBinding.Create[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Linq.Expressions.Expression`1<System.Func`1<Boolean>>, EBind.BindFlag, EBind.Configuration)
at EBind.EBinding.Add[[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Linq.Expressions.Expression`1<System.Func`1<Boolean>>, Int32)
at LifeSim.ViewModels.BuildMode.FurnitureTabViewModel..ctor(LifeSim.ViewModels.BuildMode.BuildModeActivityViewModel)
at LifeSim.ViewModels.BuildMode.BuildModeActivityViewModel..ctor(LifeSim.ViewModels.GameViewModel)
at LifeSim.ViewModels.GameViewModel.SwitchGameMode()
at LifeSim.ViewModels.GameViewModel.Input_ActionPerformed(System.Object, LifeSim.ViewModels.ActionPerformedEventArgs)
at LifeSim.Game.GameInputProvider.OnActionPerformed(LifeSim.ViewModels.ActionType)
at LifeSim.Game.GameInputProvider.Input_KeyPressed(System.Object, Veldrid.KeyEvent)
at LifeSim.Imago.Input.InputManager.UpdateFrameInput()
at LifeSim.Imago.Application.Run()
at LifeSim.Game.Program.Main(System.String[])
Of course I could use the classic PropertyChanged event here and subscribe manually to that change. It's not a big deal, just wanted to report the bug because it's a bit annoying.
The text was updated successfully, but these errors were encountered:
Hi! First, thanks for writting this amazing library. I love it. 💖
Secondly, I am using this library in my game developed using a custom game engine.
The bindings work fine but I found this special case when it crashes with a fatal
AccessViolationException
.The code in question is something like this:
I this the problem is when I try to bind to properties of a parent object that hasn't finished to run it's constructor code.
Here is the stack trace:
Of course I could use the classic
PropertyChanged
event here and subscribe manually to that change. It's not a big deal, just wanted to report the bug because it's a bit annoying.The text was updated successfully, but these errors were encountered: