-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BindingExpression has not been started #14753
Comments
Any chance you can share sample code? |
I haven't isolated it from the production app. This is a "pseudocode"
I see this binding error in debug just before it crashes
If I change it to ReflectionBinding it does not crash on start and it's even working fine. Something else (or the same thing) crashes when the app closes and detaches controls from the visual tree. |
/cc @grokys |
I have a repro case. https://gist.github.com/TomEdwardsEnscape/6bcc0db015cc4d6f44067a216b116ea4 Apply this patch to the Avalonia repo, start the Sandbox project, then click the button twice. |
* Added failing test for #14753. * Don't try to publish on non-running binding. This can happen in cases like #14653 where: 1. An event is raised with 2 binding expression subscribers 2. The first subscriber causes the 2nd subscriber to be stopped 3. The second subscriber is called from the event, even though it has been stopped (as the event list was cached at step 1) 4. It calls `PublishValue` causing an exception Easiest to just do nothing in `PublishValue` when this scenario happens.
* Added failing test for #14753. * Don't try to publish on non-running binding. This can happen in cases like #14653 where: 1. An event is raised with 2 binding expression subscribers 2. The first subscriber causes the 2nd subscriber to be stopped 3. The second subscriber is called from the event, even though it has been stopped (as the event list was cached at step 1) 4. It calls `PublishValue` causing an exception Easiest to just do nothing in `PublishValue` when this scenario happens.
Describe the bug
Haven't found the exact place but binding errors do not report properly in some cases and crash the application.
To Reproduce
Have a binding error.
I guess it has something to do with the lifetime of the control. If the property has not yet been initialized and it errors then it fails.
I could repro it either by opening the app or closing it down.
The case when opening has been fixed by using ReflectionBinding. But this was probably just hiding the issue.
Expected behavior
Don't crash, report the error.
Environment
The text was updated successfully, but these errors were encountered: