From 0528e3996f4813761627a49c20618bec26c9ea40 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 18 Oct 2023 09:18:36 -0700 Subject: [PATCH] Assets: add removeLibrary() where unloading is optional (references #1718) unloadLibrary() now calls removeLibrary() with true for unload to prevent code duplication --- src/lime/utils/Assets.hx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lime/utils/Assets.hx b/src/lime/utils/Assets.hx index dc64da5b68..ec6de0cc01 100644 --- a/src/lime/utils/Assets.hx +++ b/src/lime/utils/Assets.hx @@ -518,6 +518,11 @@ class Assets } public static function unloadLibrary(name:String):Void + { + removeLibrary(name, true); + } + + public static function removeLibrary(name:String, unload:Bool = true):Void { #if (tools && !display) if (name == null || name == "") @@ -531,7 +536,10 @@ class Assets { cache.clear(name + ":"); library.onChange.remove(library_onChange); - library.unload(); + if (unload) + { + library.unload(); + } } libraries.remove(name);