-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Thread safe issues about PathFigureCollectionConverter #11321
Copy link
Copy link
Closed
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingfixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/androidplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowst/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingfixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/androidplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalystplatform/windowst/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
It will thow some exceptions when we use PathFigureCollectionConverter to parse the string to PathFigureCollection with multi-thread.
Steps to Reproduce
The repor code:
Excepted: Work well. The PathFigureCollectionConverter can parse the path string with multi-thread.
Actual: Throw the exception.
Link to public reproduction project repository
https://github.com/lindexi/lindexi_gd/tree/abc3042ddbfc3bd46563119fc88df0463b155c8b/TestPathFigureCollectionConverter
Version with bug
6.0.486
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
All.
Did you find any workaround?
Why the PathFigureCollectionConverter not thread safe?
As the code shown, we can find the PathFigureCollectionConverter use some static fields which are not thread safe.
maui/src/Controls/src/Core/Shapes/PathFigureCollectionConverter.cs
Line 41 in a541df0
And I think we can use the local function to make the PathFigureCollectionConverter thread safe.
Relevant log output
No response