首页 > 解决方案 > Dart 使用引用隔离 SendPort 和 ReceivePort 问题

问题描述

在有引用的列表中,列表中的引用在接收端口接收后不再正确。图片保存在列表中。不引用列表中其他条目/图像的条目是正确的,但对其他图像的引用不再匹配。它们都引用同一个条目。我通过显示哈希值进行了检查。

InputList: inHash 0 729534725 (reference image1) inHash 1 58149970 (reference image2) inHash 2 729534725 (reference to image1) inHash 3 58149970 (reference to image2) inHash 4 729534725 inHash 5 58149970 inHash 6 729534725 inHash 7 58149970 inHash 8 729534725 inHash 9 58149970 inHash 10 729534725

sendAsyncPort.send(InputList)

received: outHash 0 732188156 (image1 ok) outHash 1 685649583 (image2 ok) outHash 2 685649583 (image2 wrong, input was reference to image1) outHash 3 685649583 outHash 4 685649583 outHash 5 685649583 outHash 6 685649583 outHash 7 685649583 outHash 8 685649583 outHash 9 685649583 outHash 10 685649583

有谁知道我该如何解决这个问题?

麦克风

标签: dartreferencedart-isolates

解决方案


推荐阅读