Skip to content
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

Fix: fatal exception "Element not found" in UWP multiple views apps #2215

Merged
merged 3 commits into from
Oct 15, 2019

Conversation

KAS1990
Copy link
Contributor

@KAS1990 KAS1990 commented Oct 15, 2019

1 Check _dispatcher has been initialized to prevent always calling CoreApplication.Views[0].Dispatcher
2 Wrapped Interlocked.CompareExchange by try...catch to call standard exception handler

What kind of change does this PR introduce?
It is bugfix and fixes #2188

What is the current behavior?
#2188

What is the new behavior?
App is not crashing on getting the first app view dispatcher in multiple views apps.

…reApplication.Views[0].Dispatcher

2 Wrapped Interlocked.CompareExchange by try...catch to call standard exception handler
Exceptions in Interlocked.CompareExchange will be ignored.
@KAS1990 KAS1990 requested a review from a team October 15, 2019 09:44
@glennawatson glennawatson changed the title Fixing fatal exception "Element not found" in multiple views apps Fix: fatal exception "Element not found" in multiple views apps Oct 15, 2019
@glennawatson glennawatson changed the title Fix: fatal exception "Element not found" in multiple views apps Fix: fatal exception "Element not found" in UWP multiple views apps Oct 15, 2019
@jasonwurzel
Copy link
Contributor

Hi, any news on when a new version containing this fix will be released on nuget?

@glennawatson
Copy link
Contributor

Should already have been released a while back.

@glennawatson
Copy link
Contributor

glennawatson commented Nov 19, 2019

https://github.com/reactiveui/ReactiveUI/releases/tag/10.5.6

GitHub
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable st...

@jasonwurzel
Copy link
Contributor

oh, thanks. That is strange, then maybe something is messed up on my machine...thanks for the info

@jasonwurzel
Copy link
Contributor

ok, found the cause. The fix #2215 changed the logic in "ScheduleOnDispatcherNow", but not in the classes ctor. Thus the exception still is thrown when SingleWindowDispatcherScheduler is constructed. I'll try to make a PR.

@KAS1990
Copy link
Contributor Author

KAS1990 commented Nov 19, 2019

My app has not been crashed after this update. Bug fixed. Thank you

@jasonwurzel
Copy link
Contributor

I think this was a misunderstanding. I was talking about the bug #2154 that suposedly got fixed with this merge (which isn't). So I'll try to fix it :-)

@lock lock bot locked and limited conversation to collaborators Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UWP: Exception "Element not found" is fired.
3 participants