fixed garbage collector memory leak

This commit is contained in:
Yoshman29
2022-12-30 01:58:58 +01:00
parent a6a25eff7b
commit 5cded1a197
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
1859
1863
+12 -2
View File
@@ -64,18 +64,28 @@ class AssetsLibraryList extends AssetLibrary {
if (!id.startsWith("assets/")) {
var ass = getAsset('assets/$id', type);
if (ass != null)
if (ass != null) {
#if cpp
cpp.vm.Gc.enable(true);
#end
return ass;
}
}
for(e in libraries) {
var asset = e.getAsset(id, type);
if (asset != null)
if (asset != null) {
#if cpp
cpp.vm.Gc.enable(true);
#end
return asset;
}
}
#if cpp
cpp.vm.Gc.enable(true);
#end
return null;
} catch(e) {
#if cpp
cpp.vm.Gc.enable(true);