diff --git a/buildnumber.txt b/buildnumber.txt index 68bcf6a3..466fe402 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1546 \ No newline at end of file +1548 \ No newline at end of file diff --git a/source/funkin/system/AssetsLibraryList.hx b/source/funkin/system/AssetsLibraryList.hx index d9438e47..03b8c960 100644 --- a/source/funkin/system/AssetsLibraryList.hx +++ b/source/funkin/system/AssetsLibraryList.hx @@ -57,15 +57,30 @@ class AssetsLibraryList extends AssetLibrary { } public override function getAsset(id:String, type:String) { - if (!id.startsWith("assets/")) { - var ass = getAsset('assets/$id', type); - if (ass != null) - return ass; - } - for(e in libraries) { - var asset = e.getAsset(id, type); - if (asset != null) - return asset; + try { + #if cpp + cpp.vm.Gc.enable(false); + #end + + if (!id.startsWith("assets/")) { + var ass = getAsset('assets/$id', type); + if (ass != null) + return ass; + } + for(e in libraries) { + var asset = e.getAsset(id, type); + if (asset != null) + return asset; + } + + #if cpp + cpp.vm.Gc.enable(true); + #end + } catch(e) { + #if cpp + cpp.vm.Gc.enable(true); + #end + throw e; } return null; }