Browse Source

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

Hán Trung Kiên 1 year ago
parent
commit
8e200efdbb
1 changed files with 5 additions and 0 deletions
  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();
+      });
+    }
   }
 }