Skip to content

Accessible_HighContrastChanged threading issue in dev/7.0.0 impl of ThemeListener  #3253

Closed
@0x7c13

Description

@0x7c13

This is regarding to the new dispatcher queue implementation of ThemeListener in dev/7.0.0 branch.

I made a copy of it and embedded it in my own app. Then I am start to seeing this weird exception from some of my users:

Taking look at the source code, I found this:

The error happens within this code path:
_accessible.HighContrastChanged += Accessible_HighContrastChanged;

Since high contrast change will trigger both Accessible_HighContrastChanged event as well as Settings_ColorValuesChanged event at same time. But the dispatcher is only used in Settings_ColorValuesChanged code path but not Accessible_HighContrastChanged path. I was wondering if Accessible_HighContrastChanged is getting fired off UI thread which could leads problem here?

However, after testing, I could not re-pro it on my machine. But it definitely is an issue since not only one of my users but actually 5 of them are affected. That is happening a lot after only one day of release.

Before I jump to the conclusion, I quickly did below changes in my app and the issue is gone:

Can you guys take a look and see if you can find out why this is causing the issue here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions