首页 > 解决方案 > 使用 compute() 在不同线程中转换图像会杀死隔离

问题描述

基本上,我使用了一个隔离,使用 Image 包和 Foundation Isolate 从系统目录转换可变数量的图像文件。

await compute(xyzFunc, abcArg);

执行此操作的函数将获取参数中的图像路径列表

xyzFunc(abcArg) {
    for(String path in abcArg) {
        resize(path);

这将持续到某个时间点并抛出 main() spawn exited 的错误并出现一些错误。隔离物被杀死。任何地方都没有任何消息的迹象。在这方面需要帮助。enter code here

标签: multithreadingloopsflutterdartdart-isolates

解决方案


推荐阅读