Unity-Technologies / com.unity.uiwidgets

UIWidgets is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
https://unity.cn/uiwidgets
626 stars 78 forks source link

iterate the PathMetrics crash. #301

Closed tomcatter closed 2 years ago

tomcatter commented 2 years ago

my code is

       Path outPath = ...
       PathMetrics metrics = outPath.computeMetrics(forceClose: false); 
       foreach (PathMetric me in metrics)
       {
               ....
       }

When an iterator is executed, The Unity Editor crashes!

Unity Editor carsh log below :

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Unity.UIWidgets.ui._PathMeasure.PathMeasure_nativeNextContour () [0x00008] in <a1d9e8b783754e1ba5a179a587d64908>:0
  at Unity.UIWidgets.ui._PathMeasure._nextContour () [0x00001] in E:\bennu\DeSe\Packages\com.unity.uiwidgets\Runtime\ui\painting.cs:1622
  at Unity.UIWidgets.ui.PathMetricIterator.MoveNext () [0x00001] in E:\bennu\DeSe\Packages\com.unity.uiwidgets\Runtime\ui\painting.cs:1490
  at DeSe.UI.Components._DottedDecotatorPainter.paint (Unity.UIWidgets.ui.Canvas,Unity.UIWidgets.ui.Offset,Unity.UIWidgets.painting.ImageConfiguration) [0x002c9] in 
zhuxingwei commented 2 years ago

Hi Thanks for the bug reporting!

The root cause of this issue is found and fixed. We will make a quick test later next week on all platforms then push the fix. I will ping you on this thread when the job is done. Thank you again for your great help to UIWidgets !

zhuxingwei commented 2 years ago

Issue fixed in #302

tomcatter commented 2 years ago

@zhuxingwei 我这边测试ok了