fix jsRef free error

This commit is contained in:
ekibun
2021-01-30 14:58:00 +08:00
parent 0de94f12e2
commit 442ac39c4f
2 changed files with 3 additions and 3 deletions

View File

@@ -41,11 +41,11 @@ abstract class JSRef {
if (cache.contains(obj)) return;
if (obj is List) {
cache.add(obj);
obj.forEach((e) => _callRecursive(e, cb, cache));
List.from(obj).forEach((e) => _callRecursive(e, cb, cache));
}
if (obj is Map) {
cache.add(obj);
obj.values.forEach((e) => _callRecursive(e, cb, cache));
obj.values.toList().forEach((e) => _callRecursive(e, cb, cache));
}
if (obj is JSRef) {
cb(obj);

View File

@@ -151,4 +151,4 @@ packages:
version: "2.1.0-nullsafety.5"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.20.0 <2.0.0"
flutter: ">=1.20.0"