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

Fixing stuck _isInternalSet flag #1394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BHandle
Copy link

@BHandle BHandle commented Dec 8, 2023

Fixes three cases where logic can flag that internal changes are being made to ChartElement objects and escape the scope without reverting the _isInternalSet flag. I was actually encountering this on a project where I set the stroke color of a LineSeries based on a condition in the code. Due to the timing involved, there was a race condition where I was updating the stroke color after the CartesianChart escaped due to the empty bounds with the flag still set, preventing my change from ever being applied.

@BHandle
Copy link
Author

BHandle commented Dec 8, 2023

Personally, I think _isInternalSet should be wrapped in a disposable class that can be set in a using() context to ensure it never escapes the scope, even via exception. Additionally, it would ensure that this sort of escape could never happen again. If you're interested in such a change, let me know and I can make the necessary changes.

Thanks!

@BHandle BHandle changed the title Fixing stuck internal set Fixing stuck _isInternalSet flag Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant