From 5cded1a197b64c9bde2f1edd41d41abfed6b68c2 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Fri, 30 Dec 2022 01:58:58 +0100 Subject: [PATCH] fixed garbage collector memory leak --- buildnumber.txt | 2 +- source/funkin/system/AssetsLibraryList.hx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 64a3aef1..e259f689 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1859 \ No newline at end of file +1863 \ No newline at end of file diff --git a/source/funkin/system/AssetsLibraryList.hx b/source/funkin/system/AssetsLibraryList.hx index 03b8c960..d6815f8d 100644 --- a/source/funkin/system/AssetsLibraryList.hx +++ b/source/funkin/system/AssetsLibraryList.hx @@ -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);