浏览代码

flutter: fix memory cleanup is slow due to not destroying shaders (#2470)

Hán Trung Kiên 1 年之前
父节点
当前提交
8e200efdbb
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      spine-flutter/lib/spine_flutter.dart

+ 5 - 0
spine-flutter/lib/spine_flutter.dart

@@ -183,6 +183,11 @@ class Atlas {
     for (final image in atlasPages) {
       image.dispose();
     }
+    for (final map in atlasPagePaints) {
+      map.values.forEach((element) {
+        element.shader?.dispose();
+      });
+    }
   }
 }