Fixing stuck _isInternalSet flag - #1394
Merged
Merged
Conversation
Contributor
Author
|
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! |
beto-rodriguez
approved these changes
Sep 16, 2024
beto-rodriguez
approved these changes
Sep 16, 2024
Collaborator
|
Late but merged. thanks for the PR!
That sounds amazing to prevent this kind of issues, sure a PR is welcomed! (I promise to merge sooner 🤣) |
This was referenced Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.