Skip to content

Commit

Permalink
Assets: add removeLibrary() where unloading is optional (references #…
Browse files Browse the repository at this point in the history
…1718)

unloadLibrary() now calls removeLibrary() with true for unload to prevent code duplication
  • Loading branch information
joshtynjala committed Oct 18, 2023
1 parent 9a9b89a commit 0528e39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lime/utils/Assets.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "")
Expand All @@ -531,7 +536,10 @@ class Assets
{
cache.clear(name + ":");
library.onChange.remove(library_onChange);
library.unload();
if (unload)
{
library.unload();
}
}

libraries.remove(name);
Expand Down

0 comments on commit 0528e39

Please sign in to comment.